Re: [PATCH 00/23] arch: allow pte_offset_map[_lock]() to fail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Matthew Wilcox <willy@xxxxxxxxxxxxx>
- Subject: Re: [PATCH 00/23] arch: allow pte_offset_map[_lock]() to fail
- From: Hugh Dickins <hughd@xxxxxxxxxx>
- Date: Thu, 11 May 2023 15:37:06 -0700 (PDT)
- Cc: Hugh Dickins <hughd@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Mike Kravetz <mike.kravetz@xxxxxxxxxx>, Mike Rapoport <rppt@xxxxxxxxxx>, "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Suren Baghdasaryan <surenb@xxxxxxxxxx>, Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Greg Ungerer <gerg@xxxxxxxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, Helge Deller <deller@xxxxxx>, John David Anglin <dave.anglin@xxxxxxxx>, "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Alexandre Ghiti <alexghiti@xxxxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Heiko Carstens <hca@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>, John Paul Adrian Glaubitz <glaubitz@xxxxxxxxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Chris Zankel <chris@xxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, x86@xxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, Michel Lespinasse <michel@xxxxxxxxxxxxxx>
- In-reply-to: <ZFz1j1slZHCQmwMJ@casper.infradead.org>
- References: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> <ZFs0k2rrLPH9A/UU@casper.infradead.org> <d7f3c7b2-25b8-ef66-98a8-43d68f4499f@google.com> <ZFz1j1slZHCQmwMJ@casper.infradead.org>
On Thu, 11 May 2023, Matthew Wilcox wrote:
>
> I was thinking that removing CONFIG_HIGHPTE might simplify the page
> fault handling path a little, but now I've looked at it some more, and
> I'm not sure there's any simplification to be had. It should probably
> use kmap_local instead of kmap_atomic(), though.
Re kmap_local, yes, one of the patches in the next series does make
that change.
>
> I infer that what you need is a pte_access_start() and a
> pte_access_end() which look like they can be plausibly rcu_read_lock()
> and rcu_read_unlock(), but might need to be local_irq_save() and
> local_irq_restore() in some configurations?
Yes, except that the local_irq_restore() in PAE-like configurations
(if we need it at all) is not delayed until the pte_access_end() or
pte_unmap() - it's internal to the pte_access_start() or pte_offset_map():
interrupts only disabled across the getting of a consistent pmd entry.
Over-generalizing a little, any user of pte_offset_map() (as opposed to
pte_offset_map_lock()) has to be prepared for the ptes to change under
them: but we do need to give them something that is or was recently the
relevant page table, rather than a random page mishmashed from mismatched
pmd_low and pmd_high.
>
> We also talked about moving x86 to always RCU-free page tables in
> order to make accessing /proc/$pid/smaps lockless. I believe Michel
> is going to take a swing at this project.
(And /proc/$pid/numa_maps, I hope: that's even worse in some way, IIRC.)
That might be orthogonal to what I'm doing: many non-x86 architectures
already do RCU-freeing of page tables via the TLB route, but that doesn't
cover a pte_free() from retract_page_tables() or collapse_and_free_pmd().
Hugh
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]