Thread (16 messages) 16 messages, 4 authors, 2021-12-01

Re: [PATCH v5 2/3] mm/mempolicy: add set_mempolicy_home_node syscall

From: Aneesh Kumar K.V <hidden>
Date: 2021-12-01 06:22:45
Also in: linux-mm

Andrew Morton [off-list ref] writes:
On Tue, 30 Nov 2021 14:29:02 +0530 "Aneesh Kumar K.V" [off-list ref] wrote:
quoted
quoted
What's the thinking here?  The node can later be offlined and the
kernel takes no action to reset home nodes, so why not permit setting a
presently-offline node as the home node?  Checking here seems rather
arbitrary?
The node online check was needed to avoid accessing 
uninitialised pgdat structure. Such an access can result in
below crash
Oh.  This is unobvious from reading the code.  Which calls for a
comment, no?
updated
@@ -1497,6 +1498,10 @@ SYSCALL_DEFINE4(set_mempolicy_home_node, unsigned long, start, unsigned long, le
 	if (flags != 0)
 		return -EINVAL;
 
+	/*
+	 * Check home_node is online to avoid accessing uninitialized
+	 * NODE_DATA.
+	 */
 	if (home_node >= MAX_NUMNODES || !node_online(home_node))
 		return -EINVAL;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help