Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753241AbdDKOG0 (ORCPT ); Tue, 11 Apr 2017 10:06:26 -0400 Received: from mx2.suse.de ([195.135.220.15]:49222 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752050AbdDKOGR (ORCPT ); Tue, 11 Apr 2017 10:06:17 -0400 From: Vlastimil Babka To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Li Zefan , Michal Hocko , Mel Gorman , David Rientjes , Christoph Lameter , Hugh Dickins , Andrea Arcangeli , Anshuman Khandual , "Kirill A. Shutemov" , Vlastimil Babka Subject: [RFC 2/6] mm, mempolicy: stop adjusting current->il_next in mpol_rebind_nodemask() Date: Tue, 11 Apr 2017 16:06:05 +0200 Message-Id: <20170411140609.3787-3-vbabka@suse.cz> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170411140609.3787-1-vbabka@suse.cz> References: <20170411140609.3787-1-vbabka@suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1335 Lines: 36 The task->il_next variable remembers the last allocation node for task's MPOL_INTERLEAVE policy. mpol_rebind_nodemask() updates interleave and bind mempolicies due to changing cpuset mems. Currently it also tries to make sure that current->il_next is valid within the updated nodemask. This is bogus, because 1) we are updating potentially any task's mempolicy, not just current, and 2) we might be updating per-vma mempolicy, not task one. The interleave_nodes() function that uses il_next can cope fine with the value not being within the currently allowed nodes, so this hasn't manifested as an actual issue. Thus it also won't be an issue if we just remove this adjustment completely. Signed-off-by: Vlastimil Babka --- mm/mempolicy.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 37d0b334bfe9..efeec8d2bce5 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -349,12 +349,6 @@ static void mpol_rebind_nodemask(struct mempolicy *pol, const nodemask_t *nodes, pol->v.nodes = tmp; else BUG(); - - if (!node_isset(current->il_next, tmp)) { - current->il_next = next_node_in(current->il_next, tmp); - if (current->il_next >= MAX_NUMNODES) - current->il_next = numa_node_id(); - } } static void mpol_rebind_preferred(struct mempolicy *pol, -- 2.12.2