From: Peter Xu <peterx@redhat.com>
To: Peng Zhang <zhangpeng362@huawei.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, david@redhat.com,
axelrasmussen@google.com, surenb@google.com,
lokeshgidra@google.com, Liam.Howlett@oracle.com,
wangkefeng.wang@huawei.com, sunnanyong@huawei.com
Subject: Re: [PATCH] userfaultfd: early return in dup_userfaultfd()
Date: Wed, 27 Mar 2024 14:56:59 -0400 [thread overview]
Message-ID: <ZgRr-8PX2Jdk6VKz@x1n> (raw)
In-Reply-To: <20240327090835.3232629-1-zhangpeng362@huawei.com>
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
prev parent reply other threads:[~2024-03-27 18:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 9:08 Peng Zhang
2024-03-27 18:56 ` Peter Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZgRr-8PX2Jdk6VKz@x1n \
--to=peterx@redhat.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lokeshgidra@google.com \
--cc=sunnanyong@huawei.com \
--cc=surenb@google.com \
--cc=wangkefeng.wang@huawei.com \
--cc=zhangpeng362@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®