Skip to content

Commit 4b194d7

Browse files
committed
Fixed a bug with 3.0 sysfs layouts that appear buggy. It now reads only online numa nodes and online cpus.
1 parent 53c1211 commit 4b194d7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ([2.63])
5-
AC_INIT(cpuaff,0.0.4,dcdillon@gmail.com,cpuaff)
5+
AC_INIT(cpuaff,0.0.5,dcdillon@gmail.com,cpuaff)
66
AM_INIT_AUTOMAKE
77
AC_OUTPUT(Makefile include/Makefile examples/Makefile tests/Makefile)
88
AC_CONFIG_HEADERS([config.h])

include/cpuaff/impl/linux_impl/sysfs_reader.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ inline bool read_list(std::set< int32_t > &set, const std::string &_file)
7373

7474
inline bool read_nodes(std::set< int32_t > &nodes)
7575
{
76-
return read_list(nodes, "/sys/devices/system/node/has_cpu");
76+
return read_list(nodes, "/sys/devices/system/node/online");
7777
}
7878

7979
inline bool read_cpus(std::set< int32_t > &cpus, int32_t node)
@@ -85,7 +85,7 @@ inline bool read_cpus(std::set< int32_t > &cpus, int32_t node)
8585

8686
inline bool read_cpus(std::set< int32_t > &cpus)
8787
{
88-
return read_list(cpus, "/sys/devices/system/cpu/possible");
88+
return read_list(cpus, "/sys/devices/system/cpu/online");
8989
}
9090

9191
inline int32_t read_socket(int32_t cpu)
@@ -275,4 +275,4 @@ inline bool load_cpus(std::vector< pu > &pus)
275275

276276
} // namespace linux_impl
277277
} // namespace impl
278-
} // namespace cpuaff
278+
} // namespace cpuaff

0 commit comments

Comments
 (0)