Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Michal Hocko <mhocko@kernel.org>, Oscar Salvador <osalvador@suse.de>
Cc: akpm@linux-foundation.org, david@redhat.com,
	anthony.yznaga@oracle.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm,memory_hotplug: Explicitly pass the head to isolate_huge_page
Date: Tue, 12 Feb 2019 16:13:05 -0800
Message-ID: <52f7a47c-4a8b-c06d-04c0-48d9bb43823b@oracle.com> (raw)
In-Reply-To: <20190212144026.GY15609@dhcp22.suse.cz>

On 2/12/19 6:40 AM, Michal Hocko wrote:
> On Tue 12-02-19 14:45:49, Oscar Salvador wrote:
>> On Tue, Feb 12, 2019 at 09:33:29AM +0100, Michal Hocko wrote:
>>>>  
>>>>  		if (PageHuge(page)) {
>>>>  			struct page *head = compound_head(page);
>>>> -			pfn = page_to_pfn(head) + (1<<compound_order(head)) - 1;
>>>>  			if (compound_order(head) > PFN_SECTION_SHIFT) {
>>>>  				ret = -EBUSY;
>>>>  				break;
>>>>  			}
>>>
>>> Why are we doing this, btw? 
>>
>> I assume you are referring to:
>>
>>>>                     if (compound_order(head) > PFN_SECTION_SHIFT) {
>>>>                             ret = -EBUSY;
>>>>                             break;
>>>>                     }
> 
> yes.
> 
>> I thought it was in case we stumble upon a gigantic page, and commit
>> (c8721bbbdd36 mm: memory-hotplug: enable memory hotplug to handle hugepage)
>> confirms it.
>>
>> But I am not really sure if the above condition would still hold on powerpc,
>> I wanted to check it but it is a bit more tricky than it is in x86_64 because
>> of the different hugetlb sizes.
>> Could it be that the above condition is not true, but still the order of that
>> hugetlb page goes beyond MAX_ORDER? It is something I have to check.

Well, commit 94310cbcaa3c ("mm/madvise: enable (soft|hard) offline of
HugeTLB pages at PGD level") should have allowed migration of gigantic
pages.  I believe it was added for 16GB pages on powerpc.  However, due
to subsequent changes I suspsect this no longer works.

> This check doesn't make much sense in principle. Why should we bail out
> based on a section size? We are offlining a pfn range. All that we care
> about is whether the hugetlb is migrateable.

Yes.  Do note that the do_migrate_range is only called from __offline_pages
with a start_pfn that was returned by scan_movable_pages.  scan_movable_pages
has the hugepage_migration_supported check for PageHuge pages.  So, it would
seem to be redundant to do another check in do_migrate_range.

-- 
Mike Kravetz


  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08  9:06 Oscar Salvador
2019-02-11  8:58 ` David Hildenbrand
2019-02-12  8:33 ` Michal Hocko
2019-02-12 13:45   ` Oscar Salvador
2019-02-12 14:40     ` Michal Hocko
2019-02-13  0:13       ` Mike Kravetz [this message]
2019-02-13  8:13         ` Oscar Salvador
2019-02-13 12:33           ` Michal Hocko
2019-02-13 15:15             ` 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=52f7a47c-4a8b-c06d-04c0-48d9bb43823b@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=anthony.yznaga@oracle.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=osalvador@suse.de \
    /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

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git