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] [day] [month] [year] [list]
Date:   Mon, 8 Feb 2021 21:55:56 -0500
From:   Peter Xu <peterx@...hat.com>
To:     Mike Kravetz <mike.kravetz@...cle.com>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Gal Pressman <galpress@...zon.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Christoph Hellwig <hch@....de>,
        Miaohe Lin <linmiaohe@...wei.com>,
        Kirill Shutemov <kirill@...temov.name>,
        Jann Horn <jannh@...gle.com>,
        Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Mike Rapoport <rppt@...ux.vnet.ibm.com>,
        David Gibson <david@...son.dropbear.id.au>,
        Kirill Tkhai <ktkhai@...tuozzo.com>,
        Wei Zhang <wzam@...zon.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v3 5/5] hugetlb: Do early cow when page pinned on src mm

On Mon, Feb 08, 2021 at 04:09:26PM -0800, Mike Kravetz wrote:
> On 2/5/21 8:54 AM, Peter Xu wrote:
> > This is the last missing piece of the COW-during-fork effort when there're
> > pinned pages found.  One can reference 70e806e4e645 ("mm: Do early cow for
> > pinned pages during fork() for ptes", 2020-09-27) for more information, since
> > we do similar things here rather than pte this time, but just for hugetlb.
> 
> Thanks for all the changes, the patch looks much better.
> 
> I did not look at 70e806e4e645 in detail until now.  That commit had the
> 'write protect trick' which was removed in subsequent commits.  It took me
> a bit of git history tracking to figure out the state of that code today and
> the reasons for the subsequent changes.  I guess that was a good way to
> educate me. :) 

Thanks for looking into those details.  I didn't expect that to happen since
after Jason's rework with 57efa1fe5957 ("mm/gup: prevent gup_fast from racing
with COW during fork", 2020-12-15) we can ignore the whole wr-protect idea as a
whole.  I referenced 70e806e4e645 more for the idea of why we do that, and also
copy_present_page() on how it is generally implemented.  That gup-fast race is
definitely tricky on its own.

> 
> > 
> > Signed-off-by: Peter Xu <peterx@...hat.com>
> > ---
> >  mm/hugetlb.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++----
> >  1 file changed, 62 insertions(+), 4 deletions(-)
> 
> Reviewed-by: Mike Kravetz <mike.kravetz@...cle.com>

Thanks!

I'll post a new version very soon with your r-b, and also a compile warning
fixed in the other patch as reported by Gal.

-- 
Peter Xu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ