[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1558768043-23184-1-git-send-email-zhongjiang@huawei.com>
Date: Sat, 25 May 2019 15:07:23 +0800
From: zhong jiang <zhongjiang@...wei.com>
To: <akpm@...ux-foundation.org>, <osalvador@...e.de>,
<khandual@...ux.vnet.ibm.com>, <mhocko@...e.com>,
<mgorman@...hsingularity.net>, <aarcange@...hat.com>
CC: <rcampbell@...dia.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] mm/mempolicy: Fix an incorrect rebind node in mpol_rebind_nodemask
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@...wei.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
Powered by blists - more mailing lists