diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-10-17 04:24:11 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-10-17 04:24:11 +0200 |
commit | f1e2137e9f7198a087ccf706201c648313bdae5a (patch) | |
tree | 1e5daef472322f793f04dd6c26b74e3025c0625b | |
parent | 59ba7a57144e22cd0b728b6aad564afaa50440f6 (diff) | |
parent | c18ba60fe479c8f5dfab71d5a6f1033712ee5832 (diff) | |
download | psutil-f1e2137e9f7198a087ccf706201c648313bdae5a.tar.gz |
Merge branch 'master' of github.com:giampaolo/psutil
-rw-r--r-- | psutil/_pslinux.py | 8 |
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 |