lkml.org 
[lkml]   [2018]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/migrate: Split only transparent huge pages when allocation fails
On Mon 24-09-18 19:44:55, Anshuman Khandual wrote:
> When unmap_and_move[_huge_page] function fails due to lack of memory, the
> splitting should happen only for transparent huge pages not for HugeTLB
> pages. PageTransHuge() returns true for both THP and HugeTLB pages. Hence
> the conditonal check should test PagesHuge() flag to make sure that given
> pages is not a HugeTLB one.

Well spotted! Have you actually seen this happening or this is review
driven? I am wondering what would be the real effect of this mismatch?
I have tried to follow to code path but I suspect
split_huge_page_to_list would fail for hugetlbfs pages. If there is a
more serious effect then we should mark the patch for stable as well.

>
> Fixes: 94723aafb9 ("mm: unclutter THP migration")
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
> mm/migrate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index d6a2e89..d2297fe 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -1411,7 +1411,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
> * we encounter them after the rest of the list
> * is processed.
> */
> - if (PageTransHuge(page)) {
> + if (PageTransHuge(page) && !PageHuge(page)) {
> lock_page(page);
> rc = split_huge_page_to_list(page, from);
> unlock_page(page);
> --
> 2.7.4

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2018-09-24 16:31    [W:0.051 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site