lkml.org 
[lkml]   [2018]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm, page_alloc: Fix has_unmovable_pages for HugePages
On Thu 20-12-18 00:39:18, Oscar Salvador wrote:
> On Wed, Dec 19, 2018 at 02:25:28PM +0000, Wei Yang wrote:
> > >- iter = round_up(iter + 1, 1<<compound_order(page)) - 1;
> > >+ skip_pages = (1 << compound_order(head)) - (page - head);
> > >+ iter = round_up(iter + 1, skip_pages) - 1;
> >
> > The comment of round_up says round up to next specified power of 2. And
> > second parameter must be a power of 2.
> >
> > Look skip_pages not satisfy this.

Yes this is true but the resulting numbers should be correct even for
skips that are not power of 2 AFAIC. Or do you have any counter example?

>
> At least alloc_gigantic_page() looks for 1GB range, aligned to that.
> But I see that in alloc_contig_range(), the boundaries can differ.
>
> Anyway, unless I am missing something, I think that we could just
> get rid of the round_up() and do something like:
>
> <--
> skip_pages = (1 << compound_order(head)) - (page - head);
> iter = skip_pages - 1;
> --
>
> which looks more simple IMHO.

Agreed!

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2018-12-20 10:12    [W:0.126 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site