Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3371979ybc; Thu, 21 Nov 2019 07:24:14 -0800 (PST) X-Google-Smtp-Source: APXvYqw12h4yn06SedNi01IBKPvzVzB6tnh1OlUmoYzUUEQI/jEvfk2tQBgmPYk4gC6W40rHW6zr X-Received: by 2002:a7b:c747:: with SMTP id w7mr11080568wmk.62.1574349854576; Thu, 21 Nov 2019 07:24:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574349854; cv=none; d=google.com; s=arc-20160816; b=urYTtPSJxS0G3E75+WWVdIHdmEyctCjl6iDwX6uS53Gv2bWqbm2RxDO5naIjaWRjf4 A3HMvBfTZE9xcnTrJ1TCSNmB8ZsZTzzMIFkH0OTJzJLy8vXT6o2CTrAcoIzS8RIQJAWk +mFxFaUg7HZskABCkL6fXPHBnfMV8R0oEZlTbSdTG1JlOYjX35Ez+tNlYgN/ClYy2sFs oNIWRTcWpZWmFUDn8ejJetzonp4BNm8TpZiF+cTLsFs0uMT9mUiQIoKVswr9BImQbXw5 50aBCXQ3fu/wTc8P0mKnVQHiBFJ0tk4iAIgbaSIbZbVJ43KizfCYAlsgb8J2d5tL6F+F AaVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GBZcBYMZYjcR8WI5AnmKhA2OAeDtrFXB/prwDu6wTZ8=; b=FGNjUBMpCIZYFB82qAzpHo7Uq+umOEXPZSqE90whQOTW5CXqBAxQG7/t2828R7w0S7 WXHk0G8DdMgI4l1bw4l22Aled6eTsTGkne/luChYmkh3hGmdg8U3gPG0BvthCqqB2qMO ypYwTKWEyzs+Pl0Wx1Mq/eM2n39Euv/fmtp67sE8E2n0NC+OlzUd3qfFaFZIgEXA9sfh PBYKu5dUaXXib+MhXmExzxdTXcRWgtXFdEMSSBPtFgmTPMlL17/CQmXx7HMX1xigioLQ lsiyDdel0qQGLiBvunZCjz/DYdjVphwW9fTQLw3ixAMp165OUbsA77yYGAstbPVBqbIR SFNA== 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 f23si2719316edj.380.2019.11.21.07.23.50; Thu, 21 Nov 2019 07:24:14 -0800 (PST) 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 S1727073AbfKUPUQ (ORCPT + 99 others); Thu, 21 Nov 2019 10:20:16 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:44239 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726774AbfKUPUQ (ORCPT ); Thu, 21 Nov 2019 10:20:16 -0500 X-Originating-IP: 153.3.140.100 Received: from localhost.localdomain.localdomain (unknown [153.3.140.100]) (Authenticated sender: fly@kernel.page) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 5A4B91C0024; Thu, 21 Nov 2019 15:20:07 +0000 (UTC) From: Pengfei Li To: akpm@linux-foundation.org Cc: mgorman@techsingularity.net, mhocko@kernel.org, vbabka@suse.cz, cl@linux.com, iamjoonsoo.kim@lge.com, guro@fb.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Pengfei Li Subject: [RFC v1 04/19] mm, slub: use for_each_node in get_any_partial() Date: Thu, 21 Nov 2019 23:17:56 +0800 Message-Id: <20191121151811.49742-5-fly@kernel.page> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191121151811.49742-1-fly@kernel.page> References: <20191121151811.49742-1-fly@kernel.page> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In get_any_partial(), we want to traverse node instead of zone, so use for_each_node instead of for_each_zone. Signed-off-by: Pengfei Li --- mm/slub.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index ad1abfbc57b1..2fe3edbcf296 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1905,10 +1905,10 @@ static void *get_any_partial(struct kmem_cache *s, gfp_t flags, struct kmem_cache_cpu *c) { #ifdef CONFIG_NUMA + enum zone_type high_zoneidx = gfp_zone(flags); struct nodelist *nodelist; struct nlist_traverser t; - struct zone *zone; - enum zone_type high_zoneidx = gfp_zone(flags); + int node; void *object; unsigned int cpuset_mems_cookie; @@ -1937,12 +1937,12 @@ static void *get_any_partial(struct kmem_cache *s, gfp_t flags, do { cpuset_mems_cookie = read_mems_allowed_begin(); nodelist = node_nodelist(mempolicy_slab_node(), flags); - for_each_zone_nlist(zone, &t, nodelist, high_zoneidx) { + for_each_node_nlist(node, &t, nodelist, high_zoneidx) { struct kmem_cache_node *n; - n = get_node(s, zone_to_nid(zone)); + n = get_node(s, node); - if (n && cpuset_zone_allowed(zone, flags) && + if (n && cpuset_node_allowed(node, flags) && n->nr_partial > s->min_partial) { object = get_partial_node(s, n, c, flags); if (object) { -- 2.23.0