From: Oscar Salvador <osalvador@suse.de>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: akpm@linux-foundation.org, mhocko@suse.com, vbabka@suse.cz,
pavel.tatashin@microsoft.com, rppt@linux.vnet.ibm.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm, page_alloc: Fix has_unmovable_pages for HugePages
Date: Thu, 20 Dec 2018 00:39:18 +0100 [thread overview]
Message-ID: <20181219233914.2fxe26pih26ifvmt@d104.suse.de> (raw)
In-Reply-To: <20181219142528.yx6ravdyzcqp5wtd@master>
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
next prev parent reply other threads:[~2018-12-19 23:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-17 22:51 [PATCH v2] mm, page_alloc: Fix has_unmovable_pages for HugePages Oscar Salvador
2018-12-17 22:51 ` Oscar Salvador
2018-12-17 23:07 ` Andrew Morton
2018-12-18 7:36 ` Michal Hocko
2018-12-18 21:46 ` Andrew Morton
2018-12-18 21:51 ` Oscar Salvador
2018-12-19 14:25 ` Wei Yang
2018-12-19 14:25 ` Wei Yang
2018-12-19 14:28 ` Wei Yang
2018-12-19 14:28 ` Wei Yang
2018-12-19 23:39 ` Oscar Salvador [this message]
2018-12-20 9:12 ` Michal Hocko
2018-12-20 12:49 ` Oscar Salvador
2018-12-20 13:06 ` Michal Hocko
2018-12-20 13:41 ` Oscar Salvador
2018-12-20 14:21 ` Oscar Salvador
2018-12-20 14:39 ` Michal Hocko
2018-12-20 15:37 ` Oscar Salvador
2018-12-20 15:32 ` Wei Yang
2018-12-20 15:32 ` Wei Yang
2018-12-20 15:52 ` Oscar Salvador
2018-12-20 13:08 ` Wei Yang
2018-12-20 13:49 ` Oscar Salvador
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181219233914.2fxe26pih26ifvmt@d104.suse.de \
--to=osalvador@suse.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=pavel.tatashin@microsoft.com \
--cc=richard.weiyang@gmail.com \
--cc=rppt@linux.vnet.ibm.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.