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: <f69772bf-1f42-fd0a-f23a-ed933888adc8@nvidia.com>
Date:   Wed, 31 Aug 2022 13:59:38 -0700
From:   John Hubbard <jhubbard@...dia.com>
To:     Yang Shi <shy828301@...il.com>,
        David Hildenbrand <david@...hat.com>
Cc:     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 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 Hubbard
NVIDIA

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ