linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Oscar Salvador <osalvador@suse.de>
Cc: Wei Yang <richard.weiyang@gmail.com>,
	akpm@linux-foundation.org, 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 10:12:28 +0100	[thread overview]
Message-ID: <20181220091228.GB14234@dhcp22.suse.cz> (raw)
In-Reply-To: <20181219233914.2fxe26pih26ifvmt@d104.suse.de>

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

  reply	other threads:[~2018-12-20  9:12 UTC|newest]

Thread overview: 20+ 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 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:28   ` Wei Yang
2018-12-19 23:39   ` Oscar Salvador
2018-12-20  9:12     ` Michal Hocko [this message]
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=20181220091228.GB14234@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).