From: Paolo Abeni <pabeni@redhat.com>
To: Chengfeng Ye <nicoyip.dev@gmail.com>,
Allison Henderson <achender@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
Santosh Shilimkar <santosh.shilimkar@oracle.com>,
Ka-Cheong Poon <ka-cheong.poon@oracle.com>,
Dan Carpenter <error27@gmail.com>
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2] rds: synchronize info callbacks with module unload
Date: Thu, 30 Jul 2026 12:01:58 +0200 [thread overview]
Message-ID: <26c1ea30-e6cb-4f3f-ab88-6d00f0ed2117@redhat.com> (raw)
In-Reply-To: <20260727174826.135662-1-nicoyip.dev@gmail.com>
Hi,
It looks like I was too optimistic in my previous reply.
On 7/27/26 7:48 PM, Chengfeng Ye wrote:
> @@ -78,8 +80,13 @@ void rds_info_register_func(int optname, rds_info_func func)
> BUG_ON(optname < RDS_INFO_FIRST || optname > RDS_INFO_LAST);
>
> spin_lock(&rds_info_lock);
> - BUG_ON(rds_info_funcs[offset]);
> - rds_info_funcs[offset] = func;
> + /* Validate the latest published slot value. */
> + if (WARN_ON_ONCE(smp_load_acquire(&rds_info_funcs[offset]))) {
This read is under the same lock that perform the store. It's totally
unclear why smp_load_acquire() would be needed here. Very reasonably
it's not.
> + spin_unlock(&rds_info_lock);
> + return;
> + }
> + /* Pair with lockless callback lookup. */
> + smp_store_release(&rds_info_funcs[offset], func);
> spin_unlock(&rds_info_lock);
> }
> EXPORT_SYMBOL_GPL(rds_info_register_func);
> @@ -91,9 +98,15 @@ void rds_info_deregister_func(int optname, rds_info_func func)
> BUG_ON(optname < RDS_INFO_FIRST || optname > RDS_INFO_LAST);
>
> spin_lock(&rds_info_lock);
> - BUG_ON(rds_info_funcs[offset] != func);
> - rds_info_funcs[offset] = NULL;
> + /* Validate the latest published slot value. */
> + if (WARN_ON_ONCE(smp_load_acquire(&rds_info_funcs[offset]) != func)) {
Same here.
/P
next prev parent reply other threads:[~2026-07-30 10:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 18:49 [PATCH] rds: synchronize info callbacks with connection teardown Chengfeng Ye
2026-07-23 4:20 ` Allison Henderson
2026-07-23 16:00 ` Chengfeng Ye
2026-07-27 17:48 ` [PATCH net-next v2] rds: synchronize info callbacks with module unload Chengfeng Ye
2026-07-28 21:43 ` Allison Henderson
2026-07-30 9:55 ` Paolo Abeni
2026-07-30 10:01 ` Paolo Abeni [this message]
2026-07-30 10:28 ` Chengfeng Ye
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=26c1ea30-e6cb-4f3f-ab88-6d00f0ed2117@redhat.com \
--to=pabeni@redhat.com \
--cc=achender@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=error27@gmail.com \
--cc=horms@kernel.org \
--cc=ka-cheong.poon@oracle.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicoyip.dev@gmail.com \
--cc=rds-devel@oss.oracle.com \
--cc=santosh.shilimkar@oracle.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