Hi! > Testing went OK, I came across one new issue on system supporting CPU hotplug > in > sched_setaffinity01.c / tst_ncpus_max(). > > tst_ncpus_max is using sysconf(_SC_NPROCESSORS_CONF), but sched_getaffinity > cares about all possible cpus, so it fails with EINVAL, because mask is too > small. > > I'm thinking we should try to read /sys/devices/system/cpu/possible or even > /sys/devices/system/cpu/kernel_max (NR_CPUS) and use that value to be safe > and only fall back to _SC_NPROCESSORS_CONF as last resort.
Sounds good to me. > There's a big mail thread about this issue, I think Carlos made a nice > summary: > https://sourceware.org/ml/libc-alpha/2013-07/msg00429.html I was part of the discussion, the API for getting number of processors on Linux is currently in mess :(. -- Cyril Hrubis chru...@suse.cz ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list