linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Zi Yan" <zi.yan@cs.rutgers.edu>
To: Michal Hocko <mhocko@kernel.org>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, kirill.shutemov@linux.intel.com,
	minchan@kernel.org, vbabka@suse.cz, mgorman@techsingularity.net,
	khandual@linux.vnet.ibm.com, dnellans@nvidia.com,
	dave.hansen@intel.com, n-horiguchi@ah.jp.nec.com
Subject: Re: [PATCH v9 06/10] mm: thp: check pmd migration entry in common path
Date: Wed, 19 Jul 2017 11:01:33 -0400	[thread overview]
Message-ID: <DBF3E4FD-6CC8-41E3-8C20-466645BAFF7C@cs.rutgers.edu> (raw)
In-Reply-To: <20170719080212.GB26779@dhcp22.suse.cz>

[-- Attachment #1: Type: text/plain, Size: 1779 bytes --]

On 19 Jul 2017, at 4:02, Michal Hocko wrote:

> On Mon 17-07-17 15:39:51, Zi Yan wrote:
>> From: Zi Yan <zi.yan@cs.rutgers.edu>
>>
>> If one of callers of page migration starts to handle thp,
>> memory management code start to see pmd migration entry, so we need
>> to prepare for it before enabling. This patch changes various code
>> point which checks the status of given pmds in order to prevent race
>> between thp migration and the pmd-related works.
>
> I am sorry to nitpick on the changelog but the patch is scary large and
> it would deserve much better description. What are those "various code
> point" and how do you "prevent race". How can we double check that none
> of them were missed?

Thanks for pointing this out.

Let me know if the following new description looks good to you:


When THP migration is being used, memory management code needs to handle
pmd migration entries properly. This patch uses !pmd_present() or is_swap_pmd()
(depending on whether pmd_none() needs separate code or not) to
check pmd migration entries at the places where a pmd entry is present.

Since pmd-related code uses split_huge_page(), split_huge_pmd(), pmd_trans_huge(),
pmd_trans_unstable(), or pmd_none_or_trans_huge_or_clear_bad(),
this patch:
1. adds pmd migration entry split code in split_huge_pmd(),
2. takes care of pmd migration entries whenever pmd_trans_huge() is present,
3. makes pmd_none_or_trans_huge_or_clear_bad() pmd migration entry aware.
Since split_huge_page() uses split_huge_pmd() and pmd_trans_unstable() is equivalent
to pmd_none_or_trans_huge_or_clear_bad(), we do not change them.

Until this commit, a pmd entry should be:
1. pointing to a pte page,
2. is_swap_pmd(),
3. pmd_trans_huge(),
4. pmd_devmap(), or
5. pmd_none().

--
Best Regards
Yan Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 496 bytes --]

  reply	other threads:[~2017-07-19 15:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 19:39 [PATCH v9 00/10] mm: page migration enhancement for thp Zi Yan
2017-07-17 19:39 ` [PATCH v9 01/10] mm: mempolicy: add queue_pages_required() Zi Yan
2017-07-17 19:39 ` [PATCH v9 02/10] mm: x86: move _PAGE_SWP_SOFT_DIRTY from bit 7 to bit 1 Zi Yan
2017-07-17 19:39 ` [PATCH v9 03/10] mm: thp: introduce separate TTU flag for thp freezing Zi Yan
2017-07-17 19:39 ` [PATCH v9 04/10] mm: thp: introduce CONFIG_ARCH_ENABLE_THP_MIGRATION Zi Yan
2017-07-17 19:39 ` [PATCH v9 05/10] mm: thp: enable thp migration in generic path Zi Yan
2017-07-19  8:04   ` kbuild test robot
2017-07-19 18:39     ` Zi Yan
2017-07-19 20:59       ` Andrew Morton
2017-07-20  2:54         ` Zi Yan
2017-07-17 19:39 ` [PATCH v9 06/10] mm: thp: check pmd migration entry in common path Zi Yan
2017-07-19  8:02   ` Michal Hocko
2017-07-19 15:01     ` Zi Yan [this message]
2017-07-17 19:39 ` [PATCH v9 07/10] mm: soft-dirty: keep soft-dirty bits over thp migration Zi Yan
2017-07-17 19:39 ` [PATCH v9 08/10] mm: mempolicy: mbind and migrate_pages support " Zi Yan
2017-07-17 19:39 ` [PATCH v9 09/10] mm: migrate: move_pages() supports " Zi Yan
2017-07-17 19:39 ` [PATCH v9 10/10] mm: memory_hotplug: memory hotremove " Zi Yan

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=DBF3E4FD-6CC8-41E3-8C20-466645BAFF7C@cs.rutgers.edu \
    --to=zi.yan@cs.rutgers.edu \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=dnellans@nvidia.com \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=minchan@kernel.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=vbabka@suse.cz \
    --subject='Re: [PATCH v9 06/10] mm: thp: check pmd migration entry in common path' \
    /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

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).