Re: [PATCH bpf-next v4 2/4] uaccess: Define pagefault lock guard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 07, 2025 at 08:40:37AM +0200, Viktor Malik wrote:
> Define a pagefault lock guard which allows to simplify functions that
> need to disable page faults.
> 
> Signed-off-by: Viktor Malik <vmalik@xxxxxxxxxx>
> ---
>  include/linux/uaccess.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
> index 7c06f4795670..1beb5b395d81 100644
> --- a/include/linux/uaccess.h
> +++ b/include/linux/uaccess.h
> @@ -296,6 +296,8 @@ static inline bool pagefault_disabled(void)
>   */
>  #define faulthandler_disabled() (pagefault_disabled() || in_atomic())
>  
> +DEFINE_LOCK_GUARD_0(pagefault, pagefault_disable(), pagefault_enable())

I can't help but mention that naming this scope-based cleanup helper
`pagefault` just seems overly ambiguous. That's just me though...




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux