From: Zi Yan <zi.yan@cs.rutgers.edu>
To: Michal Hocko <mhocko@kernel.org>
Cc: "Zi Yan" <zi.yan@sent.com>,
"Naoya Horiguchi" <n-horiguchi@ah.jp.nec.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
"Andrea Reale" <ar@linux.vnet.ibm.com>,
"Jérôme Glisse" <jglisse@redhat.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()
Date: Wed, 22 Nov 2017 09:43:46 -0500 [thread overview]
Message-ID: <5A158D22.3040609@cs.rutgers.edu> (raw)
In-Reply-To: <20171122134059.fmyambktkel4e3zq@dhcp22.suse.cz>
[-- Attachment #1: Type: text/plain, Size: 1785 bytes --]
Michal Hocko wrote:
> On Wed 22-11-17 09:54:16, Michal Hocko wrote:
>> On Mon 20-11-17 21:18:55, Zi Yan wrote:
> [...]
>>> diff --git a/include/linux/migrate.h b/include/linux/migrate.h
>>> index 895ec0c4942e..a2246cf670ba 100644
>>> --- a/include/linux/migrate.h
>>> +++ b/include/linux/migrate.h
>>> @@ -54,7 +54,7 @@ static inline struct page *new_page_nodemask(struct page *page,
>>> new_page = __alloc_pages_nodemask(gfp_mask, order,
>>> preferred_nid, nodemask);
>>>
>>> - if (new_page && PageTransHuge(page))
>>> + if (new_page && PageTransHuge(new_page))
>>> prep_transhuge_page(new_page);
>> I would keep the two checks consistent. But that leads to a more
>> interesting question. new_page_nodemask does
>>
>> if (thp_migration_supported() && PageTransHuge(page)) {
>> order = HPAGE_PMD_ORDER;
>> gfp_mask |= GFP_TRANSHUGE;
>> }
>
> And one more question/note. Why do we need thp_migration_supported
> in the first place? 9c670ea37947 ("mm: thp: introduce
> CONFIG_ARCH_ENABLE_THP_MIGRATION") says
> : Introduce CONFIG_ARCH_ENABLE_THP_MIGRATION to limit thp migration
> : functionality to x86_64, which should be safer at the first step.
>
> but why is unsafe to enable the feature on other arches which support
> THP? Is there any plan to do the next step and remove this config
> option?
Because different architectures have their own way of specifying a swap
entry. This means, to support THP migration, each architecture needs to
add its own __pmd_to_swp_entry() and __swp_entry_to_pmd(), which are
used for arch-independent pmd_to_swp_entry() and swp_entry_to_pmd().
We need this CONFIG_ARCH_ENABLE_THP_MIGRATION before archs that support
THP add code for pmd swap entry.
--
Best Regards,
Yan Zi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 537 bytes --]
next prev parent reply other threads:[~2017-11-22 14:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-21 2:18 [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page() Zi Yan
2017-11-21 22:12 ` Andrew Morton
2017-11-21 22:35 ` Zi Yan
2017-11-22 9:43 ` Andrea Reale
2017-11-22 8:54 ` Michal Hocko
2017-11-22 9:18 ` Zi Yan
2017-11-22 9:35 ` Michal Hocko
2017-11-22 10:14 ` Michal Hocko
2017-11-22 12:13 ` Zi Yan
2017-11-22 12:29 ` Zi Yan
2017-11-22 13:01 ` Michal Hocko
2017-11-22 13:40 ` Michal Hocko
2017-11-22 14:43 ` Zi Yan [this message]
2017-11-22 14:53 ` Michal Hocko
2017-11-22 15:09 ` Zi Yan
2017-11-22 15:39 ` Michal Hocko
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=5A158D22.3040609@cs.rutgers.edu \
--to=zi.yan@cs.rutgers.edu \
--cc=akpm@linux-foundation.org \
--cc=ar@linux.vnet.ibm.com \
--cc=jglisse@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=stable@vger.kernel.org \
--cc=zi.yan@sent.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;
as well as URLs for NNTP newsgroup(s).