lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DBF3E4FD-6CC8-41E3-8C20-466645BAFF7C@cs.rutgers.edu>
Date:   Wed, 19 Jul 2017 11:01:33 -0400
From:   "Zi Yan" <zi.yan@...rutgers.edu>
To:     "Michal Hocko" <mhocko@...nel.org>
Cc:     akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, kirill.shutemov@...ux.intel.com,
        minchan@...nel.org, vbabka@...e.cz, mgorman@...hsingularity.net,
        khandual@...ux.vnet.ibm.com, dnellans@...dia.com,
        dave.hansen@...el.com, n-horiguchi@...jp.nec.com
Subject: Re: [PATCH v9 06/10] mm: thp: check pmd migration entry in common
 path

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

Download attachment "signature.asc" of type "application/pgp-signature" (497 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ