mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
mm: introduce node_zonelist() for accessing the zonelist for a GFP mask
Introduce a node_zonelist() helper function. It is used to lookup the appropriate zonelist given a node and a GFP mask. The patch on its own is a cleanup but it helps clarify parts of the two-zonelist-per-node patchset. If necessary, it can be merged with the next patch in this set without problems. Reviewed-by: Christoph Lameter <[email protected]> Signed-off-by: Mel Gorman <[email protected]> Signed-off-by: Lee Schermerhorn <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Nick Piggin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
dac1d27bc8
commit
0e88460da6
8 changed files with 17 additions and 17 deletions
|
|
@ -1183,7 +1183,7 @@ static struct zonelist *zonelist_policy(gfp_t gfp, struct mempolicy *policy)
|
|||
nd = 0;
|
||||
BUG();
|
||||
}
|
||||
return NODE_DATA(nd)->node_zonelists + gfp_zone(gfp);
|
||||
return node_zonelist(nd, gfp);
|
||||
}
|
||||
|
||||
/* Do dynamic interleaving for a process */
|
||||
|
|
@ -1299,7 +1299,7 @@ struct zonelist *huge_zonelist(struct vm_area_struct *vma, unsigned long addr,
|
|||
if (unlikely(pol != &default_policy &&
|
||||
pol != current->mempolicy))
|
||||
__mpol_free(pol); /* finished with pol */
|
||||
return NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_flags);
|
||||
return node_zonelist(nid, gfp_flags);
|
||||
}
|
||||
|
||||
zl = zonelist_policy(GFP_HIGHUSER, pol);
|
||||
|
|
@ -1321,7 +1321,7 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order,
|
|||
struct zonelist *zl;
|
||||
struct page *page;
|
||||
|
||||
zl = NODE_DATA(nid)->node_zonelists + gfp_zone(gfp);
|
||||
zl = node_zonelist(nid, gfp);
|
||||
page = __alloc_pages(gfp, order, zl);
|
||||
if (page && page_zone(page) == zl->zones[0])
|
||||
inc_zone_page_state(page, NUMA_INTERLEAVE_HIT);
|
||||
|
|
|
|||
Loading…
Reference in a new issue