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]
Date:   Tue, 9 Aug 2022 13:59:48 -0400
From:   Peter Xu <peterx@...hat.com>
To:     "Huang, Ying" <ying.huang@...el.com>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Andrea Arcangeli <aarcange@...hat.com>,
        David Hildenbrand <david@...hat.com>,
        Minchan Kim <minchan@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        Nadav Amit <nadav.amit@...il.com>,
        Hugh Dickins <hughd@...gle.com>,
        Andi Kleen <andi.kleen@...el.com>,
        "Kirill A . Shutemov" <kirill@...temov.name>
Subject: Re: [PATCH v2 2/2] mm: Remember young/dirty bit for page migrations

On Tue, Aug 09, 2022 at 04:40:12PM +0800, Huang, Ying wrote:
> > @@ -2160,6 +2167,12 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
> >  				entry = pte_wrprotect(entry);
> >  			if (!young)
> >  				entry = pte_mkold(entry);
> > +			if (dirty)
> > +				/*
> > +				 * NOTE: this may contains setting soft
> > +				 * dirty too on some archs like x86.
> > +				 */
> 
> Personally, I prefer to put comments above "if (dirty)".  But you can
> choose your favorite way unless it violates coding style.

Sure.

> 
> > +				entry = pte_mkdirty(entry);
> 
> We don't track dirty flag even for normal PTE before.  So I think we
> should separate the dirty flag tracking for normal PTE in a separate
> patch.

It's kinda convenient to touch that up, but for sure I can split that into
a tiny but separate patch too.

[...]

> I don't find pte_dirty() is synced to PageDirty() as in
> try_to_migrate_one().  Is it a issue in the original code?

I think it has?  There is:

		/* Set the dirty flag on the folio now the pte is gone. */
		if (pte_dirty(pteval))
			folio_mark_dirty(folio);

?

Thanks,

-- 
Peter Xu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ