From: Harald Freudenberger <freude@linux.ibm.com>
To: lirongqing <lirongqing@baidu.com>
Cc: Holger Dengler <dengler@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
linux-s390@vger.kernel.org
Subject: Re: [PATCH] s390/pkey: Remove synchronize_rcu from pkey_handler_register
Date: Mon, 16 Mar 2026 10:35:43 +0100 [thread overview]
Message-ID: <09877680c056890694067390894f2e01@linux.ibm.com> (raw)
In-Reply-To: <20260313052312.2389-1-lirongqing@baidu.com>
On 2026-03-13 06:23, lirongqing wrote:
> From: Li RongQing <lirongqing@baidu.com>
>
> The synchronize_rcu() call after adding a handler to the handler_list
> is redundant because RCU readers will either see the old list or the
> new list. Removing this synchronization point reduces the blocking
> time during handler registration.
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
> drivers/s390/crypto/pkey_base.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/s390/crypto/pkey_base.c
> b/drivers/s390/crypto/pkey_base.c
> index d60cd98..c2e29d6 100644
> --- a/drivers/s390/crypto/pkey_base.c
> +++ b/drivers/s390/crypto/pkey_base.c
> @@ -60,7 +60,6 @@ int pkey_handler_register(struct pkey_handler
> *handler)
>
> list_add_rcu(&handler->list, &handler_list);
> spin_unlock(&handler_list_write_lock);
> - synchronize_rcu();
>
> module_put(handler->module);
After some deep dive into RCU, and some code review with Holger we
decided to leave this statement in the code: This is the fast path to
push the info about the updated list to the other cpus. If removed, the
other cpus may get the updated list when the RCU context is synched. As
this code is in general not performance critical and the list update
more or less only occurs at the early time in system startup the focus
is on concurrency versus performance. Maybe I'll add a comment onto
this code line...
Thanks Li RongQing for your patch and suggestions.
Harald Freudenberger
next prev parent reply other threads:[~2026-03-16 9:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 5:23 [PATCH] s390/pkey: Remove synchronize_rcu from pkey_handler_register lirongqing
2026-03-13 8:32 ` Harald Freudenberger
2026-03-13 9:06 ` Heiko Carstens
2026-03-13 9:39 ` Harald Freudenberger
2026-03-16 9:35 ` Harald Freudenberger [this message]
2026-03-16 9:54 ` 答复: [????] " Li,Rongqing(ACG CCN)
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=09877680c056890694067390894f2e01@linux.ibm.com \
--to=freude@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=dengler@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=svens@linux.ibm.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