libnuma numa_parse_cpustring adds unallowed CPU into its mask

Solution Unverified - Updated -

Issue

  • libnuma numa_parse_cpustring adds unallowed CPU into its mask.
$ ./numaparse all
1111111111111111

$ taskset -c 2-5 ./numaparse all
1111110000000000
  • It is all because it is allocating the bitmask with the internal function that sets only the bits the user has access to, then it ands with the cpu list you pass in.
  • Every different way one would use that function has a different outcome, it is literally insane.
  • The current behavior is not consistent and that via principle of least surprise, the parse_cpustring code should just set all bits in the cpustring argument, regardless of current task's cpu mask.
  • The prescribed way to operate should be parse cpustring, AND with Cpus_Allowed, then apply.

Environment

  • Red Hat Enterprise Linux 6
  • numactl-2.0.3-9.el6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.