lkml.org 
[lkml]   [2024]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] userfaultfd: early return in dup_userfaultfd()
On Wed, Mar 27, 2024 at 05:08:35PM +0800, Peng Zhang wrote:
> From: ZhangPeng <zhangpeng362@huawei.com>
>
> When vma->vm_userfaultfd_ctx.ctx is NULL, vma->vm_flags should have
> cleared __VM_UFFD_FLAGS. Therefore, there is no need to down_write or
> clear the flag, which will affect fork performance. Fix this by
> returning early if octx is NULL in dup_userfaultfd().
>
> By applying this patch we can get a 1.3% performance improvement for
> lmbench fork_prot. Results are as follows:
> base early return
> Process fork+exit: 419.1106 413.4804
>
> Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

--
Peter Xu


\
 
 \ /
  Last update: 2024-05-27 16:12    [W:0.043 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site