Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936010AbdCXQKE (ORCPT ); Fri, 24 Mar 2017 12:10:04 -0400 Received: from mail-bl2nam02on0123.outbound.protection.outlook.com ([104.47.38.123]:48458 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935710AbdCXQJg (ORCPT ); Fri, 24 Mar 2017 12:09:36 -0400 Authentication-Results: shutemov.name; dkim=none (message not signed) header.d=none;shutemov.name; dmarc=none action=none header.from=cs.rutgers.edu; Message-ID: <58D544B5.20102@cs.rutgers.edu> Date: Fri, 24 Mar 2017 11:09:25 -0500 From: Zi Yan User-Agent: Postbox 5.0.11 (Windows/20170302) MIME-Version: 1.0 To: "Kirill A. Shutemov" CC: Zi Yan , , , , , , , , , , , Subject: Re: [PATCH v4 06/11] mm: thp: check pmd migration entry in common path References: <20170313154507.3647-1-zi.yan@sent.com> <20170313154507.3647-7-zi.yan@sent.com> <20170324145042.bda52glerop5wydx@node.shutemov.name> In-Reply-To: <20170324145042.bda52glerop5wydx@node.shutemov.name> X-Enigmail-Version: 1.2.3 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig987999214556999BA2161050" X-Originating-IP: [12.1.252.66] X-ClientProxiedBy: MWHPR10CA0013.namprd10.prod.outlook.com (10.172.48.23) To CY4PR14MB1656.namprd14.prod.outlook.com (10.171.166.18) X-MS-Office365-Filtering-Correlation-Id: 88e3b5ce-4f5b-4456-b525-08d472d02993 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR14MB1656; X-Microsoft-Exchange-Diagnostics: 1;CY4PR14MB1656;3:kiav2w66mc0FpoJx0gz62v2H7mzTAujNHV2C+frOCxGgPLtxjdR+7Sm7Lho/OhJ+y164fwzwQlePRelTxEw286IBE0dX/3/3RBCnH4Rf8TuQTIJ2vf2Xc9OstfvWl8XSENJ/39hQE5T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FfmsrCQkNqFrtiSQK7jpl1lHBQJabdMJ79G32UeQRFZ1HtoBNU5d8JYI6iTUTrgWKIPFQQRLLKKzJgFYHvyu7eUoXrAAXMeKhOPMwjIdXacs6q53M4By9vk2BixDhTp1Z8JDq4TcEt1gz+PIQupXg6lG/5epjN09yd0NjVVdfIxfJ1KhrSCVJ/7DX/vDF7KcFFeFecx+ARgIUUf394Rr8NBvHJ6HzckC8PjWSk3f6A3I5PL58kIm/ua+w7mX+6wvban3cu0Jl2KnW632BWM+dQFLLvdlfjAEAyV5RdH3k9cE27TIRN1lxzHjo/6weQYDKupJliRp2SIalxcm64gjcWH3HPY1nj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123558025)(20161123562025)(20161123560025)(20161123564025)(20161123555025)(6072148);SRVR:CY4PR14MB1656;BCL:0;PCL:0;RULEID:;SRVR:CY4PR14MB1656; X-Microsoft-Exchange-Diagnostics: 1;CY4PR14MB1656;4:rTMShBs2hCDAAI+67hrCCPnph1T2e0fpWJdyl9d1XAjH2ykHjXkuwkgT7F17HErtdhNi9ej1s9EJcOVwyL7D9hloAsXnYvmxdxbLTadmbHaXvbKOXHxN08wgu01Dm9+/0sDJQaKj09EDt8bRw7pGlzjPAcimUM3lJJIU6aAlrfOtan+W8Efl2Su835Ygs3ZVuaZVGSrrGcg5cZkLZDDyvpM19qqUa6DFIR6gmhc5s1VW8vjvq188FxigQP1Z+Sj+4AGv6l47ecqZyphyEtKrd1uDKBbZYbm/KMDgSwF6SoS9egZK2ei1B0adQY89CSawyuWRDqody2r2e3vWEpQJnhjSSaGqQtZ1zDoX2jbDQLBjem733QEWowb579dvUHxxt3jP32iiv/m/ioRBNSl/jTzcKbneCmCnfGuKWr1QIBwCRpz9MJmAXEPVGilkRV75fwWuq/Dv863G7QWiuwp8XALVGplYohiP3NCYEsEOAVEHklIh5J6N/0NhCtLKJ0Nr55H2gKEkISl2TkHP++Nbk+tyrZWk8brCrB2MtOIf2hb60OKasQ0rgg9pC5vDeEZwY9NdmoL6zPA85f830NRE0DofbAu6+dA2lSsnbugSw7yvjhYfNOk6sOqFgXSYXwKCsei369PLDgXhDPsy2hFWow== X-Forefront-PRVS: 0256C18696 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(39450400003)(39830400002)(39410400002)(54534003)(24454002)(69224002)(568964002)(90366009)(8656002)(6486002)(77096006)(4326008)(53936002)(2906002)(3846002)(38730400002)(7416002)(84326002)(6116002)(88552002)(25786009)(5890100001)(81166006)(21480400002)(8676002)(65816999)(6246003)(575784001)(76176999)(6916009)(54356999)(110136004)(42186005)(50986999)(189998001)(512874002)(229853002)(54906002)(75432002)(7736002)(66066001)(33656002)(42882006)(86362001)(305945005)(6666003)(4001350100001)(5660300001)(2950100002)(83506001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR14MB1656;H:[10.20.179.71];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR14MB1656;23:jUAGLil+ZVdPJCzUxSrYRX9xviytDa/I6zyXoiWFO?= =?us-ascii?Q?izSonuKpZLhhAhfaxiQI9ILQASD/6v4ky2UBdVGrQqnU32X70NDHY7P01GEN?= =?us-ascii?Q?YRQjNZqPOhz+E3AzKU1C7R8adAxzs+d0ccIK6fiwNkRe33jP2z7Li+oD/wg0?= =?us-ascii?Q?hEZE+GXbaQJErMMlnABAARuDooV3MjqnNcfOmFX6g5cnuDLkvvjXWTGECr9b?= =?us-ascii?Q?JywoUVJkNIOTjx64gvGlDnjlUb+uNINihQKMPPNUd7GfYKoHbPNtTijnYvjg?= =?us-ascii?Q?HeRQhF8X/DNxsf1v3fWkh/9pbSULupUNMYKZE/b0zyEhm2r/DKGz8Q1cZ+KM?= =?us-ascii?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GX215JzHqraPuu2F1iliq/x9yKTf295lveL5v3Scuxw09VeTvVxVzZaKzO+mfHWtxMjMpZHLpOTrCZGieOXlTNkNaHZzsJB/uFIOWAadWXlxBehwxwPWwNNIyzjtUiFrrGh9Vfb9WRGej57WdkeA9wC3ItA3NgyC6HOL93lagC4zUXY6Ifg3Gxa9dnj+UzlXC8zmYREag== X-OriginatorOrg: cs.rutgers.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2017 16:09:30.9675 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR14MB1656 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9054 Lines: 298 --------------enig987999214556999BA2161050 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Kirill A. Shutemov wrote: > On Mon, Mar 13, 2017 at 11:45:02AM -0400, Zi Yan wrote: >> From: Naoya Horiguchi >> >> 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. >> >> ChangeLog v1 -> v2: >> - introduce pmd_related() (I know the naming is not good, but can't >> think up no better name. Any suggesntion is welcomed.) >> >> Signed-off-by: Naoya Horiguchi >> >> ChangeLog v2 -> v3: >> - add is_swap_pmd() >> - a pmd entry should be pmd pointing to pte pages, is_swap_pmd(), >> pmd_trans_huge(), pmd_devmap(), or pmd_none() >> - use pmdp_huge_clear_flush() instead of pmdp_huge_get_and_clear() >> - flush_cache_range() while set_pmd_migration_entry() >> - pmd_none_or_trans_huge_or_clear_bad() and pmd_trans_unstable() retur= n >> true on pmd_migration_entry, so that migration entries are not >> treated as pmd page table entries. >> >> Signed-off-by: Zi Yan >> --- >> arch/x86/mm/gup.c | 4 +-- >> fs/proc/task_mmu.c | 22 +++++++++------ >> include/asm-generic/pgtable.h | 3 +- >> include/linux/huge_mm.h | 14 +++++++-- >> mm/gup.c | 22 +++++++++++++-- >> mm/huge_memory.c | 66 ++++++++++++++++++++++++++++++++++= ++++----- >> mm/madvise.c | 2 ++ >> mm/memcontrol.c | 2 ++ >> mm/memory.c | 9 ++++-- >> mm/mprotect.c | 6 ++-- >> mm/mremap.c | 2 +- >> 11 files changed, 124 insertions(+), 28 deletions(-) >> >> diff --git a/mm/gup.c b/mm/gup.c >> index 94fab8fa432b..2b1effb16242 100644 >> --- a/mm/gup.c >> +++ b/mm/gup.c >> @@ -272,6 +272,15 @@ struct page *follow_page_mask(struct vm_area_stru= ct *vma, >> return page; >> return no_page_table(vma, flags); >> } >> + if ((flags & FOLL_NUMA) && pmd_protnone(*pmd)) >> + return no_page_table(vma, flags); >> + if (!pmd_present(*pmd)) { >> +retry: >> + if (likely(!(flags & FOLL_MIGRATION))) >> + return no_page_table(vma, flags); >> + pmd_migration_entry_wait(mm, pmd); >> + goto retry; >=20 > This looks a lot like endless loop if flags contain FOLL_MIGRATION. Hm?= >=20 > I guess retry label should be on previous line. You are right. It should be: + if ((flags & FOLL_NUMA) && pmd_protnone(*pmd)) + return no_page_table(vma, flags); +retry: + if (!pmd_present(*pmd)) { + if (likely(!(flags & FOLL_MIGRATION))) + return no_page_table(vma, flags); + pmd_migration_entry_wait(mm, pmd); + goto retry; >=20 >> + } >> if (pmd_devmap(*pmd)) { >> ptl =3D pmd_lock(mm, pmd); >> page =3D follow_devmap_pmd(vma, address, pmd, flags); >> @@ -286,6 +295,15 @@ struct page *follow_page_mask(struct vm_area_stru= ct *vma, >> return no_page_table(vma, flags); >> =20 >> ptl =3D pmd_lock(mm, pmd); >> + if (unlikely(!pmd_present(*pmd))) { >> +retry_locked: >> + if (likely(!(flags & FOLL_MIGRATION))) { >> + spin_unlock(ptl); >> + return no_page_table(vma, flags); >> + } >> + pmd_migration_entry_wait(mm, pmd); >> + goto retry_locked; >=20 > Again. That's doesn't look right.. It will be changed: ptl =3D pmd_lock(mm, pmd); +retry_locked: + if (unlikely(!pmd_present(*pmd))) { + if (likely(!(flags & FOLL_MIGRATION))) { + spin_unlock(ptl); + return no_page_table(vma, flags); + } + pmd_migration_entry_wait(mm, pmd); + goto retry_locked; >=20 >> + } >> if (unlikely(!pmd_trans_huge(*pmd))) { >> spin_unlock(ptl); >> return follow_page_pte(vma, address, pmd, flags); >> @@ -341,7 +359,7 @@ static int get_gate_page(struct mm_struct *mm, uns= igned long address, >> pud =3D pud_offset(pgd, address); >> BUG_ON(pud_none(*pud)); >> pmd =3D pmd_offset(pud, address); >> - if (pmd_none(*pmd)) >> + if (!pmd_present(*pmd)) >> return -EFAULT; >> VM_BUG_ON(pmd_trans_huge(*pmd)); >> pte =3D pte_offset_map(pmd, address); >> @@ -1369,7 +1387,7 @@ static int gup_pmd_range(pud_t pud, unsigned lon= g addr, unsigned long end, >> pmd_t pmd =3D READ_ONCE(*pmdp); >> =20 >> next =3D pmd_addr_end(addr, end); >> - if (pmd_none(pmd)) >> + if (!pmd_present(pmd)) >> return 0; >> =20 >> if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd))) { >> diff --git a/mm/huge_memory.c b/mm/huge_memory.c >> index a9c2a0ef5b9b..3f18452f3eb1 100644 >> --- a/mm/huge_memory.c >> +++ b/mm/huge_memory.c >> @@ -898,6 +898,21 @@ int copy_huge_pmd(struct mm_struct *dst_mm, struc= t mm_struct *src_mm, >> =20 >> ret =3D -EAGAIN; >> pmd =3D *src_pmd; >> + >> + if (unlikely(is_pmd_migration_entry(pmd))) { >=20 > Shouldn't you first check that the pmd is not present? is_pmd_migration_entry() checks !pmd_present(). in linux/swapops.h, is_pmd_migration_entry is defined as: static inline int is_pmd_migration_entry(pmd_t pmd) { return !pmd_present(pmd) && is_migration_entry(pmd_to_swp_entry(pmd))= ; } >=20 >> + swp_entry_t entry =3D pmd_to_swp_entry(pmd); >> + >> + if (is_write_migration_entry(entry)) { >> + make_migration_entry_read(&entry); >> + pmd =3D swp_entry_to_pmd(entry); >> + set_pmd_at(src_mm, addr, src_pmd, pmd); >> + } >> + set_pmd_at(dst_mm, addr, dst_pmd, pmd); >> + ret =3D 0; >> + goto out_unlock; >> + } >> + WARN_ONCE(!pmd_present(pmd), "Uknown non-present format on pmd.\n");= >=20 > Typo. Got it. >=20 >> + >> if (unlikely(!pmd_trans_huge(pmd))) { >> pte_free(dst_mm, pgtable); >> goto out_unlock; >> @@ -1204,6 +1219,9 @@ int do_huge_pmd_wp_page(struct vm_fault *vmf, pm= d_t orig_pmd) >> if (unlikely(!pmd_same(*vmf->pmd, orig_pmd))) >> goto out_unlock;j >> =20 >> + if (unlikely(!pmd_present(orig_pmd))) >> + goto out_unlock; >> + >> page =3D pmd_page(orig_pmd); >> VM_BUG_ON_PAGE(!PageCompound(page) || !PageHead(page), page); >> /* >> @@ -1338,7 +1356,15 @@ struct page *follow_trans_huge_pmd(struct vm_ar= ea_struct *vma, >> if ((flags & FOLL_NUMA) && pmd_protnone(*pmd)) >> goto out; >> =20 >> - page =3D pmd_page(*pmd); >> + if (is_pmd_migration_entry(*pmd)) { >=20 > Again, I don't think it's it's safe to check if pmd is migration entry > before checking if it's present. >=20 >> + swp_entry_t entry; >> + >> + entry =3D pmd_to_swp_entry(*pmd); >> + page =3D pfn_to_page(swp_offset(entry)); >> + if (!is_migration_entry(entry)) >> + goto out; >=20 > I don't understand how it suppose to work. > You take swp_offset() of entry before checking if it's migration entry.= > What's going on? This chunk of change inside follow_trans_huge_pmd() is not needed. Because two callers, smaps_pmd_entry() and follow_page_mask(), guarantee that the pmd points to a present entry. I will drop this chunk in the next version. >=20 >> + } else >> + page =3D pmd_page(*pmd); >> VM_BUG_ON_PAGE(!PageHead(page) && !is_zone_device_page(page), page);= >> if (flags & FOLL_TOUCH) >> touch_pmd(vma, addr, pmd); >> @@ -1534,6 +1560,9 @@ bool madvise_free_huge_pmd(struct mmu_gather *tl= b, struct vm_area_struct *vma, >> if (is_huge_zero_pmd(orig_pmd)) >> goto out; >> =20 >> + if (unlikely(!pmd_present(orig_pmd))) >> + goto out; >> + >> page =3D pmd_page(orig_pmd); >> /* >> * If other processes are mapping this page, we couldn't discard >> @@ -1766,6 +1795,20 @@ int change_huge_pmd(struct vm_area_struct *vma,= pmd_t *pmd, >> if (prot_numa && pmd_protnone(*pmd)) >> goto unlock; >> =20 >> + if (is_pmd_migration_entry(*pmd)) { >> + swp_entry_t entry =3D pmd_to_swp_entry(*pmd); >> + >> + if (is_write_migration_entry(entry)) { >> + pmd_t newpmd; >> + >> + make_migration_entry_read(&entry); >> + newpmd =3D swp_entry_to_pmd(entry); >> + set_pmd_at(mm, addr, pmd, newpmd); >> + } >> + goto unlock; >> + } else if (!pmd_present(*pmd)) >> + WARN_ONCE(1, "Uknown non-present format on pmd.\n"); >=20 > Another typo. Got it. Thanks for all your comments. --=20 Best Regards, Yan Zi --------------enig987999214556999BA2161050 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJY1US2AAoJEEGLLxGcTqbMooMH+wYgd5Lm3zvaMZn4S7JJK9KD WcvaNB3k7OPz/S4X3Tcrp1pLuReCfmt57EZ8Hz2DjT9TnAT7u0OYRQR9KR2xD1ER iJ01X8+lXX1bI1zSvdq6aqLpRj11oCHvtuSp1DXym6QEVH5mJMtdHRvYSuXjg4Cj Nq3FwWBXMzt3Ixr4uib2hHPDhwvSEkerQ3usYAJeonvALnTNCWFCa8oabBcmQVBA ltWF6WqKEqb6vu8XaT2RhElqJ3pnWotm0Vy50sEiU+uKet8I/o52uZvwYM7tafGc 05OxWjHBNo0WzYmo51ag9IGqjXPQb7iRKawpoh55wmLh0+Et5nui1hX+d4qMOM4= =SKiM -----END PGP SIGNATURE----- --------------enig987999214556999BA2161050--