Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1370071ybi; Sat, 25 May 2019 00:10:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPv0BlBc0e9qWna9AiE9kdPhHjGYDqAA6ghDPuhZ8ZbVuskHe0Fym1BterNGHffKYnE0kY X-Received: by 2002:a63:5e42:: with SMTP id s63mr18003821pgb.234.1558768235983; Sat, 25 May 2019 00:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558768235; cv=none; d=google.com; s=arc-20160816; b=cJm6dbcVhGPw08d6Fplp95aGENlArLm38mahLlsGUg8/63YqT3auzdEC+2pLg5I0WK iaLwOq6zLNq4DaiIToMIkhzqa+SUNHnBCGd3c37p2eOz3mnOIhYDoKLqRF3mWsapBq1T J/3gByUj/PbNcy/kRKht58Gas8nEAv2uJkr/wfvoXgyi2xIbZkoSD7VX8SH5I+UxfZpe /iRXOHiYjzl0Rn3L6ZmO+gU88pY6nFl+mcPVw0lJpVMw4fwBS5duZu4J1vxYJ4uAvtIA /P1rjRyVgrasXrOXVcaooMCR3M9GKhbMcFEP+mfFDcPsUDHGRpKRFJptAmi3iPLZ5VGN 93rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=v9OYij6c9eNalblMpuxD7oLAlGCSrYZgSELJoBCXtXM=; b=KvAehGF3hESBgGp6FkpOEkVnSE7s+hVGwZBx/CRV+afxQzWlbhW9ndkHs/1ftGqADJ QyfIqbJhSOGNWfep45h9Dcp/b24o37tWUnsvURAlLXVm88RFLAp+UYHY4WqqWGkRYaI0 5YJKP2yShDTbJia2uR/yxqUReGRMMkkX/rHzNwsH6SCnGqwMcKQPpA+Hbv09hUqdakER iPB3hG09pSOIlp2XdAOn0Hnwe+EQTiCqRlGs75ijRD/i8lSxxHSjno/6f3PqKLJzpWYg oZMAbD9PchFfNUOXF+s/nturKU+dv6/Sb+EVIQuFz+lB/QHQUwHuZ3kw+9vD7sF+oRW3 JuuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e26si6978069pgm.542.2019.05.25.00.10.20; Sat, 25 May 2019 00:10:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726628AbfEYHJO (ORCPT + 99 others); Sat, 25 May 2019 03:09:14 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:56354 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726368AbfEYHJN (ORCPT ); Sat, 25 May 2019 03:09:13 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 4D45CB5C057E2B867E12; Sat, 25 May 2019 15:09:10 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Sat, 25 May 2019 15:09:06 +0800 From: zhong jiang To: , , , , , CC: , , Subject: [PATCH] mm/mempolicy: Fix an incorrect rebind node in mpol_rebind_nodemask Date: Sat, 25 May 2019 15:07:23 +0800 Message-ID: <1558768043-23184-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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