lkml.org 
[lkml]   [2019]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC v1 02/19] mm, hugetlb: use for_each_node in dequeue_huge_page_nodemask()
    Date
    In dequeue_huge_page_nodemask(), we want to traverse node instead of
    zone, so use for_each_node instead of for_each_zone.

    Signed-off-by: Pengfei Li <fly@kernel.page>
    ---
    mm/hugetlb.c | 15 ++++-----------
    1 file changed, 4 insertions(+), 11 deletions(-)

    diff --git a/mm/hugetlb.c b/mm/hugetlb.c
    index 2e55ec5dc84d..287b90c7ab36 100644
    --- a/mm/hugetlb.c
    +++ b/mm/hugetlb.c
    @@ -850,25 +850,18 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask,
    unsigned int cpuset_mems_cookie;
    struct nodelist *nodelist;
    struct nlist_traverser t;
    - struct zone *zone;
    - int node = NUMA_NO_NODE;
    + int node;

    nodelist = node_nodelist(nid, gfp_mask);

    retry_cpuset:
    cpuset_mems_cookie = read_mems_allowed_begin();
    - for_each_zone_nlist_nodemask(zone, &t, nodelist, gfp_zone(gfp_mask), nmask) {
    + for_each_node_nlist_nodemask(node, &t, nodelist,
    + gfp_zone(gfp_mask), nmask) {
    struct page *page;

    - if (!cpuset_zone_allowed(zone, gfp_mask))
    - continue;
    - /*
    - * no need to ask again on the same node. Pool is node rather than
    - * zone aware
    - */
    - if (zone_to_nid(zone) == node)
    + if (!cpuset_node_allowed(node, gfp_mask))
    continue;
    - node = zone_to_nid(zone);

    page = dequeue_huge_page_node_exact(h, node);
    if (page)
    --
    2.23.0
    \
     
     \ /
      Last update: 2019-11-21 16:20    [W:2.333 / U:0.104 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site