[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2B8D97F1-6E87-4556-ADBF-102D3C386478@cs.rutgers.edu>
Date: Tue, 11 Dec 2018 14:07:49 -0500
From: "Zi Yan" <zi.yan@...rutgers.edu>
To: "Konstantin Khlebnikov" <khlebnikov@...dex-team.ru>,
"Peter Xu" <peterx@...hat.com>
Cc: linux-kernel@...r.kernel.org,
"Andrea Arcangeli" <aarcange@...hat.com>,
"Andrew Morton" <akpm@...ux-foundation.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
"Matthew Wilcox" <willy@...radead.org>,
"Michal Hocko" <mhocko@...e.com>,
"Dave Jiang" <dave.jiang@...el.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
"Souptick Joarder" <jrdr.linux@...il.com>, linux-mm@...ck.org
Subject: Re: [PATCH v2] mm: thp: fix flags for pmd migration when split
On 11 Dec 2018, at 3:21, Konstantin Khlebnikov wrote:
>
> Write/read-only is encoded into migration entry.
> I suppose there should be something like this:
>
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2151,16 +2151,21 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
>
> entry = pmd_to_swp_entry(old_pmd);
> page = pfn_to_page(swp_offset(entry));
> + write = is_write_migration_entry(entry);
> + young = false;
> + soft_dirty = pmd_swp_soft_dirty(old_pmd);
> } else
> #endif
> + {
> page = pmd_page(old_pmd);
> + if (pmd_dirty(old_pmd))
> + SetPageDirty(page);
> + write = pmd_write(old_pmd);
> + young = pmd_young(old_pmd);
> + soft_dirty = pmd_soft_dirty(old_pmd);
> + }
> VM_BUG_ON_PAGE(!page_count(page), page);
> page_ref_add(page, HPAGE_PMD_NR - 1);
> - if (pmd_dirty(old_pmd))
> - SetPageDirty(page);
> - write = pmd_write(old_pmd);
> - young = pmd_young(old_pmd);
> - soft_dirty = pmd_soft_dirty(old_pmd);
>
> /*
> * Withdraw the table only after we mark the pmd entry invalid.
>
This one should fix the issue. Thanks.
Reviewed-by: Zi Yan <zi.yan@...rutgers.edu>
Fixes 84c3fc4e9c563 ("mm: thp: check pmd migration entry in common path")
Do we need to cc: stable@...r.kernel.org # 4.14+ ?
--
Best Regards,
Yan Zi
Download attachment "signature.asc" of type "application/pgp-signature" (517 bytes)
Powered by blists - more mailing lists