[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHbLzkrM-977rN1J4ppdr7ocMd91ngs=eHJX_h0uX+k-efXHxw@mail.gmail.com>
Date: Wed, 31 Aug 2022 14:42:09 -0700
From: Yang Shi <shy828301@...il.com>
To: John Hubbard <jhubbard@...dia.com>
Cc: David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
Jason Gunthorpe <jgg@...dia.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Hugh Dickins <hughd@...gle.com>, Peter Xu <peterx@...hat.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCH v1] mm/ksm: update stale comment in write_protect_page()
On Wed, Aug 31, 2022 at 1:59 PM John Hubbard <jhubbard@...dia.com> wrote:
>
> On 8/31/22 12:43, Yang Shi wrote:
> >>> It looks powerpc does issue IPI for pmd flush. But arm64 doesn't IIRC.
> >>>
> >>> So maybe we should implement pmdp_collapse_flush() for those arches to
> >>> issue IPI.
> >>
> >> ... or find another way to detect and handle this in GUP-fast?
> >>
> >> Not sure if, for handling PMDs, it could be sufficient to propagate the
> >> pmdp pointer + value and double check that the values didn't change.
> >
> > Should work too, right before pinning the page.
> >
> > pmdp_collapse_flush() is actually just called by khugepaged, so arch
> > specific implementation should not be a problem and we avoid making
> > gup fast more complicated.
> >
>
> And just to pile on, about that gup fast complexity: depending upon IPIs
> added a lot of complexity, not just because of the IPI dependency, but
> more importantly because only some arches even *have* IPIs. So an
> entirely different set of reasoning has to be used *in addition* to
> working through the IPI story. And sure enough, we can see the fallout:
> you are uncovering lots of half-correct comments in that area.
>
> So getting rid of the dependency on IPIs in gup fast would go a long way
> to simplifying it, and maybe even improving overall CPU load (insert
> some hand-wavy notes here about IPIs being worse than things like RCU).
>
> But the real win is in the complexity reduction in gup fast.
Thanks, John. Yeah, I still had some wrong impressions about how to
serialize against fast GUP. If you guys thought fixing the problem in
gup code is the preferred way, I won't insist on arch-specific
pmdp_collapse_flush().
>
>
> thanks,
>
> --
> John Hubbard
> NVIDIA
Powered by blists - more mailing lists