diff options
| author | ZhangPeng <[email protected]> | 2024-03-27 17:08:35 +0800 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-04-25 20:56:25 -0700 |
| commit | afd584398b51eba12d0ffa4e0e0a493323993103 (patch) | |
| tree | b4a25841bb77576d694d669cd491ce321413d645 /tools/perf/scripts/python/netdev-times.py | |
| parent | 08b8247ebd2b70367ab3a87657efb237662bd8f6 (diff) | |
userfaultfd: early return in dup_userfaultfd()
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
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: ZhangPeng <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Cc: Axel Rasmussen <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Kefeng Wang <[email protected]>
Cc: Liam R. Howlett <[email protected]>
Cc: Lokesh Gidra <[email protected]>
Cc: Nanyong Sun <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/netdev-times.py')
0 files changed, 0 insertions, 0 deletions