lkml.org 
[lkml]   [2021]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 5/5] mm,page_alloc: Drop unnecessary checks from pfn_range_valid_contig
On Wed 17-03-21 12:12:51, Oscar Salvador wrote:
> pfn_range_valid_contig() bails out when it finds an in-use page or a
> hugetlb page, among other things.
> We can drop the in-use page check since __alloc_contig_pages can migrate
> away those pages, and the hugetlb page check can go too since
> isolate_migratepages_range is now capable of dealing with hugetlb pages.
> Either way, those checks are racy so let the end function handle it
> when the time comes.

I haven't realized PageHuge check is done this early. This means that
previous patches are not actually active until now which is not really
greate for bisectability. Can we remove the HugePage check earlier?

Act to the page_count check removal. We should rely on migrate_pages
here.

> Signed-off-by: Oscar Salvador <osalvador@suse.de>
> Suggested-by: David Hildenbrand <david@redhat.com>
> ---
> mm/page_alloc.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 4cb455355f6d..50d73e68b79e 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -8685,12 +8685,6 @@ static bool pfn_range_valid_contig(struct zone *z, unsigned long start_pfn,
>
> if (PageReserved(page))
> return false;
> -
> - if (page_count(page) > 0)
> - return false;
> -
> - if (PageHuge(page))
> - return false;
> }
> return true;
> }
> --
> 2.16.3

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2021-03-17 15:32    [W:0.283 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site