lkml.org 
[lkml]   [2021]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@google.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

\
 
 \ /
  Last update: 2021-06-09 23:13    [W:0.061 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site