linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/mempolicy: Fix an incorrect rebind node in mpol_rebind_nodemask
@ 2019-05-25  7:07 zhong jiang
  2019-05-25 18:28 ` Andrew Morton
  2019-06-27  9:59 ` Vlastimil Babka
  0 siblings, 2 replies; 7+ messages in thread
From: zhong jiang @ 2019-05-25  7:07 UTC (permalink / raw)
  To: akpm, osalvador, khandual, mhocko, mgorman, aarcange
  Cc: rcampbell, linux-mm, linux-kernel

We bind an different node to different vma, Unluckily,
it will bind different vma to same node by checking the /proc/pid/numa_maps.   
Commit 213980c0f23b ("mm, mempolicy: simplify rebinding mempolicies when updating cpusets")
has introduced the issue.  when we change memory policy by seting cpuset.mems,
A process will rebind the specified policy more than one times. 
if the cpuset_mems_allowed is not equal to user specified nodes. hence the issue will trigger.
Maybe result in the out of memory which allocating memory from same node.

Fixes: 213980c0f23b ("mm, mempolicy: simplify rebinding mempolicies when updating cpusets") 
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 mm/mempolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index e3ab1d9..a60a3be 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -345,7 +345,7 @@ static void mpol_rebind_nodemask(struct mempolicy *pol, const nodemask_t *nodes)
 	else {
 		nodes_remap(tmp, pol->v.nodes,pol->w.cpuset_mems_allowed,
 								*nodes);
-		pol->w.cpuset_mems_allowed = tmp;
+		pol->w.cpuset_mems_allowed = *nodes;
 	}
 
 	if (nodes_empty(tmp))
-- 
1.7.12.4


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

end of thread, other threads:[~2019-06-27 10:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-25  7:07 [PATCH] mm/mempolicy: Fix an incorrect rebind node in mpol_rebind_nodemask zhong jiang
2019-05-25 18:28 ` Andrew Morton
2019-05-27 12:23   ` Vlastimil Babka
2019-05-27 13:58     ` zhong jiang
2019-06-27  3:57       ` Andrew Morton
2019-06-27  7:47         ` Vlastimil Babka
2019-06-27  9:59 ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).