linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* No system call to determine MAX_NUMNODES?
@ 2019-02-06 23:13 Ralph Campbell
  2019-02-07  0:27 ` Alexander Duyck
  0 siblings, 1 reply; 5+ messages in thread
From: Ralph Campbell @ 2019-02-06 23:13 UTC (permalink / raw)
  To: Linux MM

I was using the latest git://git.cmpxchg.org/linux-mmotm.git and noticed 
a new issue compared to 5.0.0-rc5.

It looks like there is no convenient way to query the kernel's value for 
MAX_NUMNODES yet this is used in kernel_get_mempolicy() to validate the 
'maxnode' parameter to the GET_MEMPOLICY(2) system call.
Otherwise, EINVAL is returned.

Searching the internet for get_mempolicy yields some references that 
recommend reading /proc/<pid>/status and parsing the line "Mems_allowed:".

Running "cat /proc/self/status | grep Mems_allowed:" I get:
With 5.0.0-rc5:
Mems_allowed:   00000000,00000001
With 5.0.0-rc5-mm1:
Mems_allowed:   1
(both kernels were config'ed with CONFIG_NODES_SHIFT=6)

Clearly, there should be a better way to query MAX_NUMNODES like 
sysconf(), sysctl(), or libnuma.

I searched for the patch that changed /proc/self/status but didn't find it.

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-13 14:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06 23:13 No system call to determine MAX_NUMNODES? Ralph Campbell
2019-02-07  0:27 ` Alexander Duyck
2019-02-13  9:26   ` Vlastimil Babka
2019-02-13 14:25     ` Florian Weimer
2019-02-13 14:48       ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox