[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191121151811.49742-6-fly@kernel.page>
Date: Thu, 21 Nov 2019 23:17:57 +0800
From: Pengfei Li <fly@...nel.page>
To: akpm@...ux-foundation.org
Cc: mgorman@...hsingularity.net, mhocko@...nel.org, vbabka@...e.cz,
cl@...ux.com, iamjoonsoo.kim@....com, guro@...com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Pengfei Li <fly@...nel.page>
Subject: [RFC v1 05/19] mm, slab: use for_each_node in fallback_alloc()
In fallback_alloc(), we want to traverse node instead of zone, so
use for_each_node instead of for_each_zone.
Signed-off-by: Pengfei Li <fly@...nel.page>
---
mm/slab.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index b9a1353cf2ab..b94c06934459 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3103,12 +3103,11 @@ static void *alternate_node_alloc(struct kmem_cache *cachep, gfp_t flags)
*/
static void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
{
- struct nodelist *nodelist;
- struct nlist_traverser t;
- struct zone *zone;
enum zone_type high_zoneidx = gfp_zone(flags);
void *obj = NULL;
struct page *page;
+ struct nodelist *nodelist;
+ struct nlist_traverser t;
int nid;
unsigned int cpuset_mems_cookie;
@@ -3124,10 +3123,8 @@ static void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
* Look through allowed nodes for objects available
* from existing per node queues.
*/
- for_each_zone_nlist(zone, &t, nodelist, high_zoneidx) {
- nid = zone_to_nid(zone);
-
- if (cpuset_zone_allowed(zone, flags) &&
+ for_each_node_nlist(nid, &t, nodelist, high_zoneidx) {
+ if (cpuset_node_allowed(nid, flags) &&
get_node(cache, nid) &&
get_node(cache, nid)->free_objects) {
obj = ____cache_alloc_node(cache,
--
2.23.0
Powered by blists - more mailing lists