Re: [RFC][PATCH 3/8] x86/mm: break out user address space handling

From: Peter Zijlstra
Date: Sat Sep 08 2018 - 05:38:24 EST


On Fri, Sep 07, 2018 at 12:48:57PM -0700, Dave Hansen wrote:
> +static noinline void
> +__do_page_fault(struct pt_regs *regs, unsigned long hw_error_code,
> + unsigned long address)
> +{
> + prefetchw(&current->mm->mmap_sem);
> +
> + if (unlikely(kmmio_fault(regs, address)))
> + return;
> +
> + /* Was the fault on kernel-controlled part of the address space? */
> + if (unlikely(fault_in_kernel_space(address)))
> + do_kern_addr_space_fault(regs, hw_error_code, address);
> + else
> + do_user_addr_space_fault(regs, hw_error_code, address);
> +}

How about: do_{user,kernel}_fault() ? That _addr_space_ is just a lot of
typing for no real benefit imo.