summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-10-17 04:24:11 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2020-10-17 04:24:11 +0200
commitf1e2137e9f7198a087ccf706201c648313bdae5a (patch)
tree1e5daef472322f793f04dd6c26b74e3025c0625b
parent59ba7a57144e22cd0b728b6aad564afaa50440f6 (diff)
parentc18ba60fe479c8f5dfab71d5a6f1033712ee5832 (diff)
downloadpsutil-f1e2137e9f7198a087ccf706201c648313bdae5a.tar.gz
Merge branch 'master' of github.com:giampaolo/psutil
-rw-r--r--psutil/_pslinux.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py
index 382a17fa..153ddc29 100644
--- a/psutil/_pslinux.py
+++ b/psutil/_pslinux.py
@@ -618,12 +618,12 @@ def cpu_count_logical():
def cpu_count_physical():
"""Return the number of physical cores in the system."""
# Method #1
- core_ids = set()
+ thread_siblings_lists = set()
for path in glob.glob(
- "/sys/devices/system/cpu/cpu[0-9]*/topology/core_id"):
+ "/sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list"):
with open_binary(path) as f:
- core_ids.add(int(f.read()))
- result = len(core_ids)
+ thread_siblings_lists.add(f.read())
+ result = len(thread_siblings_lists)
if result != 0:
return result