• Kefeng Wang's avatar
    x86: mm: accelerate pagefault when badaccess · bc7996c8
    Kefeng Wang authored
    The access_error() of vma is already checked under per-VMA lock, if it is
    a bad access, directly handle error, no need to retry with mmap_lock
    again.  In order to release the correct lock, pass the mm_struct into
    bad_area_access_error().  If mm is NULL, release vma lock, or release
    mmap_lock.  Since the page faut is handled under per-VMA lock, count it as
    a vma lock event with VMA_LOCK_SUCCESS.
    
    Link: https://lkml.kernel.org/r/20240403083805.1818160-8-wangkefeng.wang@huawei.comReviewed-by: default avatarSuren Baghdasaryan <surenb@google.com>
    Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
    Cc: Albert Ou <aou@eecs.berkeley.edu>
    Cc: Alexander Gordeev <agordeev@linux.ibm.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Cc: Nicholas Piggin <npiggin@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Russell King <linux@armlinux.org.uk>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    bc7996c8
fault.c 42.6 KB