[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230821123056.2109942-1-wangkefeng.wang@huawei.com>
Date: Mon, 21 Aug 2023 20:30:46 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: Andrew Morton <akpm@...ux-foundation.org>, <linux-mm@...ck.org>
CC: <surenb@...gle.com>, <willy@...radead.org>,
Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Gerald Schaefer <gerald.schaefer@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
<x86@...nel.org>, "H . Peter Anvin" <hpa@...or.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <loongarch@...ts.linux.dev>,
<linuxppc-dev@...ts.ozlabs.org>, <linux-riscv@...ts.infradead.org>,
<linux-s390@...r.kernel.org>,
Kefeng Wang <wangkefeng.wang@...wei.com>
Subject: [PATCH rfc -next v2 00/10] mm: convert to generic VMA lock-based page fault
Add a generic VMA lock-based page fault handler in mm core, and convert
architectures to use it, which eliminate architectures's duplicated
codes.
With it, we can avoid multiple changes in architectures's code if we
add new feature or bugfix, in the end, enable this feature on ARM32
and Loongarch.
This is based on next-20230817, only built test.
v2:
- convert "int arch_vma_check_access()" to "bool arch_vma_access_error()"
still use __weak function for arch_vma_access_error(), which avoid to
declare access_error() in architecture's(x86/powerpc/riscv/loongarch)
headfile.
- re-use struct vm_fault instead of adding new struct vm_locked_fault,
per Matthew Wilcox, add necessary pt_regs/fault error code/vm flags
into vm_fault since they could be used in arch_vma_access_error()
- add special VM_FAULT_NONE and make try_vma_locked_page_fault() to
return vm_fault_t
Kefeng Wang (10):
mm: add a generic VMA lock-based page fault handler
arm64: mm: use try_vma_locked_page_fault()
x86: mm: use try_vma_locked_page_fault()
s390: mm: use try_vma_locked_page_fault()
powerpc: mm: use try_vma_locked_page_fault()
riscv: mm: use try_vma_locked_page_fault()
ARM: mm: try VMA lock-based page fault handling first
loongarch: mm: cleanup __do_page_fault()
loongarch: mm: add access_error() helper
loongarch: mm: try VMA lock-based page fault handling first
arch/arm/Kconfig | 1 +
arch/arm/mm/fault.c | 35 ++++++++----
arch/arm64/mm/fault.c | 60 ++++++++-------------
arch/loongarch/Kconfig | 1 +
arch/loongarch/mm/fault.c | 111 ++++++++++++++++++++++----------------
arch/powerpc/mm/fault.c | 66 +++++++++++------------
arch/riscv/mm/fault.c | 58 +++++++++-----------
arch/s390/mm/fault.c | 66 ++++++++++-------------
arch/x86/mm/fault.c | 55 ++++++++-----------
include/linux/mm.h | 17 ++++++
include/linux/mm_types.h | 2 +
mm/memory.c | 39 ++++++++++++++
12 files changed, 278 insertions(+), 233 deletions(-)
--
2.27.0
Powered by blists - more mailing lists