[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50eb41a-e6f8-e566-20ef-22fb63b0a529@google.com>
Date: Wed, 9 Jun 2021 14:11:19 -0700 (PDT)
From: Hugh Dickins <hughd@...gle.com>
To: Yang Shi <shy828301@...il.com>
cc: Hugh Dickins <hughd@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Wang Yugui <wangyugui@...-tech.com>,
Matthew Wilcox <willy@...radead.org>,
Naoya Horiguchi <naoya.horiguchi@....com>,
Alistair Popple <apopple@...dia.com>,
Ralph Campbell <rcampbell@...dia.com>, Zi Yan <ziy@...dia.com>,
Miaohe Lin <linmiaohe@...wei.com>,
Minchan Kim <minchan@...nel.org>, Jue Wang <juew@...gle.com>,
Peter Xu <peterx@...hat.com>, Jan Kara <jack@...e.cz>,
Shakeel Butt <shakeelb@...gle.com>,
Oscar Salvador <osalvador@...e.de>,
Linux MM <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 06/10] mm/thp: unmap_mapping_page() to fix THP
truncate_cleanup_page()
On Wed, 9 Jun 2021, Yang Shi wrote:
> On Tue, Jun 8, 2021 at 9:19 PM Hugh Dickins <hughd@...gle.com> wrote:
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -1361,7 +1361,17 @@ static inline unsigned long zap_pmd_range(struct mmu_gather *tlb,
> > else if (zap_huge_pmd(tlb, vma, pmd, addr))
> > goto next;
> > /* fall through */
> > + } else if (details && details->single_page &&
> > + PageTransCompound(details->single_page) &&
> > + next - addr == HPAGE_PMD_SIZE && pmd_none(*pmd)) {
> > + /*
> > + * Take and drop THP pmd lock so that we cannot return
> > + * prematurely, while zap_huge_pmd() has cleared *pmd,
> > + * but not yet decremented compound_mapcount().
> > + */
> > + spin_unlock(pmd_lock(tlb->mm, pmd));
>
> Just a nit, why not follow the style of patch #3 to have lock and
> unlock with separate lines?
Good point. Doing it on one line is my own preferred style (particularly
with the "take and drop lock" comment just above), carried forward from
before. I simply didn't think to change this one when I agreed to change
the other. You're right to question it: v3 of just this 06/10 follows.
And thank you to Kirill and to you for these rapid further reviews (and
for silently forgiving my screwup in omitting to Cc linux-mm and lkml
on those early ones).
Hugh
Powered by blists - more mailing lists