34 lines
1.1 KiB
Diff
34 lines
1.1 KiB
Diff
From 24efd8cf2fbde73636c4c8434447b0e04dc7a89a Mon Sep 17 00:00:00 2001
|
|
From: John Kacur <jkacur@redhat.com>
|
|
Date: Tue, 19 Nov 2019 12:12:33 +0100
|
|
Subject: [PATCH] rteval: Don't assume cpu0 cannot be offlined, test it
|
|
|
|
Don't just assume that cpu0 cannot be offlined.
|
|
If the file /sys/devices/system/cpu/cpu0/online exists, then test the
|
|
value just like for every other cpu
|
|
|
|
However, if the file doesn't exist, that means that it cannot be
|
|
offlined.
|
|
|
|
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
---
|
|
rteval/systopology.py | 2 --
|
|
1 file changed, 2 deletions(-)
|
|
|
|
diff --git a/rteval/systopology.py b/rteval/systopology.py
|
|
index 9556e51d96a2..7c3878e51be4 100644
|
|
--- a/rteval/systopology.py
|
|
+++ b/rteval/systopology.py
|
|
@@ -117,8 +117,6 @@ class CpuList(object):
|
|
def is_online(self, n):
|
|
if n not in self.cpulist:
|
|
raise RuntimeError("invalid cpu number %d" % n)
|
|
- if n == 0:
|
|
- return True
|
|
path = os.path.join(CpuList.cpupath,'cpu%d' % n)
|
|
# Some hardware doesn't allow cpu0 to be turned off
|
|
if not os.path.exists(path + '/online') and n == 0:
|
|
--
|
|
2.20.1
|
|
|