From: Mike Kravetz <mike.kravetz@oracle.com>
To: Alexandru Moise <00moses.alexander00@gmail.com>,
akpm@linux-foundation.org,
Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: mhocko@suse.com, n-horiguchi@ah.jp.nec.com,
aneesh.kumar@linux.vnet.ibm.com, punit.agrawal@arm.com,
gerald.schaefer@de.ibm.com, aarcange@redhat.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kirill@shutemov.name
Subject: Re: [PATCH] mm, hugetlb: fix "treat_as_movable" condition in htlb_alloc_mask
Date: Fri, 29 Sep 2017 14:16:10 -0700 [thread overview]
Message-ID: <e085bc8c-6614-5c9b-6702-5ed477bc856c@oracle.com> (raw)
In-Reply-To: <20170929204321.GA593@gmail.com>
Adding Anshuman
On 09/29/2017 01:43 PM, Alexandru Moise wrote:
> On Fri, Sep 29, 2017 at 05:13:39PM +0200, Alexandru Moise wrote:
>>
>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
>> index 424b0ef08a60..ab28de0122af 100644
>> --- a/mm/hugetlb.c
>> +++ b/mm/hugetlb.c
>> @@ -926,7 +926,7 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask,
>> /* Movability of hugepages depends on migration support. */
>> static inline gfp_t htlb_alloc_mask(struct hstate *h)
>> {
>> - if (hugepages_treat_as_movable || hugepage_migration_supported(h))
>> + if (hugepages_treat_as_movable && hugepage_migration_supported(h))
>> return GFP_HIGHUSER_MOVABLE;
>> else
>> return GFP_HIGHUSER;
>> --
>> 2.14.2
>>
>
> I seem to have terribly misunderstood the semantics of this flag wrt hugepages,
> please ignore this for now.
That is Okay, it made me look at this code more closely.
static inline bool hugepage_migration_supported(struct hstate *h)
{
#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
if ((huge_page_shift(h) == PMD_SHIFT) ||
(huge_page_shift(h) == PGDIR_SHIFT))
return true;
else
return false;
#else
return false;
#endif
}
So, hugepage_migration_supported() can only return true if
ARCH_ENABLE_HUGEPAGE_MIGRATION is defined. Commit c177c81e09e5
restricts hugepage_migration_support to x86_64. So,
ARCH_ENABLE_HUGEPAGE_MIGRATION is only defined for x86_64.
Commit 94310cbcaa3c added the ability to migrate gigantic hugetlb pages
at the PGD level. This added the check for PGD level pages to
hugepage_migration_supported(), which is only there if
ARCH_ENABLE_HUGEPAGE_MIGRATION is defined. IIUC, this functionality
was added for powerpc. Yet, powerpc does not define
ARCH_ENABLE_HUGEPAGE_MIGRATION (unless I am missing something).
--
Mike Kravetz
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-09-29 21:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 15:13 Alexandru Moise
2017-09-29 20:43 ` Alexandru Moise
2017-09-29 21:16 ` Mike Kravetz [this message]
2017-09-30 8:35 ` Alexandru Moise
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=e085bc8c-6614-5c9b-6702-5ed477bc856c@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=00moses.alexander00@gmail.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=gerald.schaefer@de.ibm.com \
--cc=khandual@linux.vnet.ibm.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=punit.agrawal@arm.com \
/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