linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: osalvador@suse.de
To: Michal Hocko <mhocko@kernel.org>
Cc: akpm@linux-foundation.org, vbabka@suse.cz,
	rppt@linux.vnet.ibm.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, owner-linux-mm@kvack.org
Subject: Re: [PATCH] mm, page_alloc: Fix has_unmovable_pages for HugePages
Date: Mon, 17 Dec 2018 16:34:48 +0100	[thread overview]
Message-ID: <a4cf58c096f2f521e2b53745621c4562@suse.de> (raw)
In-Reply-To: <20181217152936.GR30879@dhcp22.suse.cz>

On 2018-12-17 16:29, Michal Hocko wrote:
> On Mon 17-12-18 16:06:51, Oscar Salvador wrote:
> [...]
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index a6e7bfd18cde..18d41e85f672 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -8038,11 +8038,12 @@ bool has_unmovable_pages(struct zone *zone, 
>> struct page *page, int count,
>>  		 * handle each tail page individually in migration.
>>  		 */
>>  		if (PageHuge(page)) {
>> +			struct page *head = compound_head(page);
>> 
>> -			if (!hugepage_migration_supported(page_hstate(page)))
>> +			if (!hugepage_migration_supported(page_hstate(head)))
>>  				goto unmovable;
> 
> OK, this makes sense.
> 
>> 
>> -			iter = round_up(iter + 1, 1<<compound_order(page)) - 1;
>> +			iter = round_up(iter + 1, 1<<compound_order(head)) - 1;
> 
> but this less so. You surely do not want to move by the full hugetlb
> page when you got a tail page, right? You could skip too much. You have
> to consider page - head into the equation.

Argh, you're quite right.
I will amend it in the next version.

      reply	other threads:[~2018-12-17 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17 15:06 Oscar Salvador
2018-12-17 15:29 ` Michal Hocko
2018-12-17 15:34   ` osalvador [this message]

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=a4cf58c096f2f521e2b53745621c4562@suse.de \
    --to=osalvador@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=owner-linux-mm@kvack.org \
    --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