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: <YvPLI0GdrlEWF959@xz-m1.local>
Date:   Wed, 10 Aug 2022 11:13:39 -0400
From:   Peter Xu <peterx@...hat.com>
To:     "Huang, Ying" <ying.huang@...el.com>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Minchan Kim <minchan@...nel.org>,
        David Hildenbrand <david@...hat.com>,
        Nadav Amit <nadav.amit@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Hugh Dickins <hughd@...gle.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Andi Kleen <andi.kleen@...el.com>,
        "Kirill A . Shutemov" <kirill@...temov.name>
Subject: Re: [PATCH v3 4/7] mm/thp: Carry over dirty bit when thp splits on
 pmd

On Wed, Aug 10, 2022 at 02:24:33PM +0800, Huang, Ying wrote:
> Peter Xu <peterx@...hat.com> writes:
> 
> > Carry over the dirty bit from pmd to pte when a huge pmd splits.  It
> > shouldn't be a correctness issue since when pmd_dirty() we'll have the page
> > marked dirty anyway, however having dirty bit carried over helps the next
> > initial writes of split ptes on some archs like x86.
> >
> > Signed-off-by: Peter Xu <peterx@...hat.com>
> > ---
> >  mm/huge_memory.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> > index 0611b2fd145a..e8e78d1bac5f 100644
> > --- a/mm/huge_memory.c
> > +++ b/mm/huge_memory.c
> > @@ -2005,7 +2005,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
> >  	pgtable_t pgtable;
> >  	pmd_t old_pmd, _pmd;
> >  	bool young, write, soft_dirty, pmd_migration = false, uffd_wp = false;
> > -	bool anon_exclusive = false;
> > +	bool anon_exclusive = false, dirty = false;
> >  	unsigned long addr;
> >  	int i;
> >  
> > @@ -2098,6 +2098,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
> >  			SetPageDirty(page);
> >  		write = pmd_write(old_pmd);
> >  		young = pmd_young(old_pmd);
> > +		dirty = pmd_dirty(old_pmd);
> 
> Nitpick: This can be put under
> 
> 		if (pmd_dirty(old_pmd))
> 			SetPageDirty(page);
> 
> Not a big deal.
> 
> Reviewed-by: "Huang, Ying" <ying.huang@...el.com>

Yeah will do, thanks.

-- 
Peter Xu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ