[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181219233914.2fxe26pih26ifvmt@d104.suse.de>
Date: Thu, 20 Dec 2018 00:39:18 +0100
From: Oscar Salvador <osalvador@...e.de>
To: Wei Yang <richard.weiyang@...il.com>
Cc: akpm@...ux-foundation.org, mhocko@...e.com, vbabka@...e.cz,
pavel.tatashin@...rosoft.com, rppt@...ux.vnet.ibm.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm, page_alloc: Fix has_unmovable_pages for HugePages
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.
I thought that gigantic pages were always allocated on 1GB aligned.
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.
It should just work for 2MB and 1GB Hugepages.
--
Oscar Salvador
SUSE L3
Powered by blists - more mailing lists