Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1664620 > unrolled thread

[RFC PATCH 0/4] mm, hugetlb: allow proper node fallback dequeue

Started byMichal Hocko <mhocko@kernel.org>
First post2017-06-13 11:10 +0200
Last post2017-06-16 13:50 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [RFC PATCH 0/4] mm, hugetlb: allow proper node fallback dequeue Michal Hocko <mhocko@kernel.org> - 2017-06-13 11:10 +0200
    [RFC PATCH 4/4] mm, hugetlb, soft_offline: use new_page_nodemask for soft offline migration Michal Hocko <mhocko@kernel.org> - 2017-06-13 11:10 +0200
      Re: [RFC PATCH 4/4] mm, hugetlb, soft_offline: use new_page_nodemask  for soft offline migration Vlastimil Babka <vbabka@suse.cz> - 2017-06-14 18:30 +0200
    Re: [RFC PATCH 0/4] mm, hugetlb: allow proper node fallback dequeue Michal Hocko <mhocko@kernel.org> - 2017-06-16 13:50 +0200

#1664620 — [RFC PATCH 0/4] mm, hugetlb: allow proper node fallback dequeue

FromMichal Hocko <mhocko@kernel.org>
Date2017-06-13 11:10 +0200
Subject[RFC PATCH 0/4] mm, hugetlb: allow proper node fallback dequeue
Message-ID<tRPZL-65q-3@gated-at.bofh.it>
Hi,
while working on a hugetlb migration issue addressed in a separate
patchset [1] I have noticed that the hugetlb allocations from the
preallocated pool are quite subotimal. There is no fallback mechanism
implemented and no notion of preferred node. I have tried to work
around it by [2] but Vlastimil was right to push back for a more robust
solution. It seems that such a solution is to reuse zonelist approach
we use for the page alloctor.

This series has 4 patches. The first one tries to make hugetlb
allocation layers more clear. The second one implements the zonelist
hugetlb pool allocation and introduces a preferred node semantic which
is used by the migration callbacks. The third patch is a pure clean up
as well as the last patch.

Note that this patch depends on [1] (without the last patch which
is replaced by this work). You can find the whole series in
git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git branch
attempts/hugetlb-zonelists

I am sending this as an RFC because I might be missing some subtle
dependencies which led to the original design.

Shortlog
Michal Hocko (4):
      mm, hugetlb: unclutter hugetlb allocation layers
      hugetlb: add support for preferred node to alloc_huge_page_nodemask
      mm, hugetlb: get rid of dequeue_huge_page_node
      mm, hugetlb, soft_offline: use new_page_nodemask for soft offline migration

And the diffstat looks promissing as well

 include/linux/hugetlb.h |   3 +-
 include/linux/migrate.h |   2 +-
 mm/hugetlb.c            | 233 ++++++++++++++++--------------------------------
 mm/memory-failure.c     |  10 +--
 4 files changed, 82 insertions(+), 166 deletions(-)

[1] http://lkml.kernel.org/r/20170608074553.22152-1-mhocko@kernel.org
[2] http://lkml.kernel.org/r/20170608074553.22152-5-mhocko@kernel.org

[toc] | [next] | [standalone]


#1664622 — [RFC PATCH 4/4] mm, hugetlb, soft_offline: use new_page_nodemask for soft offline migration

FromMichal Hocko <mhocko@kernel.org>
Date2017-06-13 11:10 +0200
Subject[RFC PATCH 4/4] mm, hugetlb, soft_offline: use new_page_nodemask for soft offline migration
Message-ID<tRPZM-65q-29@gated-at.bofh.it>
In reply to#1664620
From: Michal Hocko <mhocko@suse.com>

new_page is yet another duplication of the migration callback which has
to handle hugetlb migration specially. We can safely use the generic
new_page_nodemask for the same purpose.

Please note that gigantic hugetlb pages do not need any special handling
because alloc_huge_page_nodemask will make sure to check pages in all
per node pools. The reason this was done previously was that
alloc_huge_page_node treated NO_NUMA_NODE and a specific node
differently and so alloc_huge_page_node(nid) would check on this
specific node.

Noticed-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Michal Hocko <mhocko@suse.com>
---
 mm/memory-failure.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 3615bffbd269..7040f60ecb71 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1487,16 +1487,8 @@ EXPORT_SYMBOL(unpoison_memory);
 static struct page *new_page(struct page *p, unsigned long private, int **x)
 {
 	int nid = page_to_nid(p);
-	if (PageHuge(p)) {
-		struct hstate *hstate = page_hstate(compound_head(p));
 
-		if (hstate_is_gigantic(hstate))
-			return alloc_huge_page_node(hstate, NUMA_NO_NODE);
-
-		return alloc_huge_page_node(hstate, nid);
-	} else {
-		return __alloc_pages_node(nid, GFP_HIGHUSER_MOVABLE, 0);
-	}
+	return new_page_nodemask(p, nid, &node_states[N_MEMORY]);
 }
 
 /*
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1666049 — Re: [RFC PATCH 4/4] mm, hugetlb, soft_offline: use new_page_nodemask for soft offline migration

FromVlastimil Babka <vbabka@suse.cz>
Date2017-06-14 18:30 +0200
SubjectRe: [RFC PATCH 4/4] mm, hugetlb, soft_offline: use new_page_nodemask for soft offline migration
Message-ID<tSjl7-7u8-1@gated-at.bofh.it>
In reply to#1664622
On 06/13/2017 11:00 AM, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
> 
> new_page is yet another duplication of the migration callback which has
> to handle hugetlb migration specially. We can safely use the generic
> new_page_nodemask for the same purpose.
> 
> Please note that gigantic hugetlb pages do not need any special handling
> because alloc_huge_page_nodemask will make sure to check pages in all
> per node pools. The reason this was done previously was that
> alloc_huge_page_node treated NO_NUMA_NODE and a specific node
> differently and so alloc_huge_page_node(nid) would check on this
> specific node.
> 
> Noticed-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: Michal Hocko <mhocko@suse.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/memory-failure.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 3615bffbd269..7040f60ecb71 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1487,16 +1487,8 @@ EXPORT_SYMBOL(unpoison_memory);
>  static struct page *new_page(struct page *p, unsigned long private, int **x)
>  {
>  	int nid = page_to_nid(p);
> -	if (PageHuge(p)) {
> -		struct hstate *hstate = page_hstate(compound_head(p));
>  
> -		if (hstate_is_gigantic(hstate))
> -			return alloc_huge_page_node(hstate, NUMA_NO_NODE);
> -
> -		return alloc_huge_page_node(hstate, nid);
> -	} else {
> -		return __alloc_pages_node(nid, GFP_HIGHUSER_MOVABLE, 0);
> -	}
> +	return new_page_nodemask(p, nid, &node_states[N_MEMORY]);
>  }
>  
>  /*
> 

[toc] | [prev] | [next] | [standalone]


#1667659

FromMichal Hocko <mhocko@kernel.org>
Date2017-06-16 13:50 +0200
Message-ID<tSXVg-7TE-41@gated-at.bofh.it>
In reply to#1664620
JFYI I will repost sometimes next week unless there is another feedback
by then.
-- 
Michal Hocko
SUSE Labs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web