lkml.org 
[lkml]   [2020]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 05/12] mm/hugetlb: unify hugetlb migration callback function
On Wed 27-05-20 15:44:56, Joonsoo Kim wrote:
[...]
> -/* page migration callback function */
> struct page *alloc_huge_page_nodemask(struct hstate *h,
> struct alloc_control *ac)
> {
> ac->gfp_mask |= htlb_alloc_mask(h);
> + if (ac->nid == NUMA_NO_NODE)
> + ac->gfp_mask &= ~__GFP_THISNODE;

Is this really needed? alloc_huge_page_node is currently only called
from numa migration code and the target node should be always defined.

>
> spin_lock(&hugetlb_lock);
> if (h->free_huge_pages - h->resv_huge_pages > 0) {
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 3b6b551..e705efd 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -1073,9 +1073,10 @@ struct page *alloc_new_node_page(struct page *page, unsigned long node)
> struct alloc_control ac = {
> .nid = node,
> .nmask = NULL,
> + .gfp_mask = __GFP_THISNODE,
> };
>
> - return alloc_huge_page_node(h, &ac);
> + return alloc_huge_page_nodemask(h, &ac);
> } else if (PageTransHuge(page)) {
> struct page *thp;
>
> --
> 2.7.4
>

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2020-06-09 15:44    [W:0.187 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site