From: Yonghong Song <yhs@meta.com>
To: Jason Gunthorpe <jgg@nvidia.com>,
"Paul E. McKenney" <paulmck@kernel.org>
Cc: Yonghong Song <yhs@fb.com>, Leon Romanovsky <leonro@nvidia.com>,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/core: Remove rcu attr for uverbs_api_ioctl_method.handler
Date: Tue, 25 Oct 2022 10:51:51 -0700 [thread overview]
Message-ID: <d2709848-3026-8104-adf2-bd28a74cc639@meta.com> (raw)
In-Reply-To: <Y1gPOUIaKOVmK0Ok@nvidia.com>
On 10/25/22 9:30 AM, Jason Gunthorpe wrote:
> On Tue, Oct 25, 2022 at 09:29:09AM -0700, Paul E. McKenney wrote:
>> On Tue, Oct 25, 2022 at 01:00:02PM -0300, Jason Gunthorpe wrote:
>>> On Tue, Oct 25, 2022 at 08:24:20AM -0700, Yonghong Song wrote:
>>>> The current uverbs_api_ioctl_method definition:
>>>> struct uverbs_api_ioctl_method {
>>>> int(__rcu *handler)(struct uverbs_attr_bundle *attrs);
>>>> DECLARE_BITMAP(attr_mandatory, UVERBS_API_ATTR_BKEY_LEN);
>>>> ...
>>>> };
>>>> The struct member 'handler' is marked with __rcu. But unless
>>>> the function body pointed by 'handler' is changing (e.g., jited)
>>>> during runtime, there is no need with __rcu.
>>>
>>> Huh? This is a sparse marker, it says that the pointer must always be
>>> loaded with rcu_dereference
>>>
>>> It has nothing to do with JIT, this patch is not correct
>>
>> OK, I will bite...
>>
>> This is a pointer to a function. Given that this function's code is
>> generated at compile time, what sequence of changes is rcu_dereference()
>> protecting against?
>
> Module unload. We set the value to NULL and then synchronize_rcu
> before unloading the code it points at.
Okay. Thanks for explanation. I forgot the module unload case.
I will look at compiler side then.
>
> Jason
next prev parent reply other threads:[~2022-10-25 17:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 15:24 [PATCH] RDMA/core: Remove rcu attr for uverbs_api_ioctl_method.handler Yonghong Song
2022-10-25 16:00 ` Jason Gunthorpe
2022-10-25 16:29 ` Paul E. McKenney
2022-10-25 16:30 ` Jason Gunthorpe
2022-10-25 17:51 ` Yonghong Song [this message]
2022-10-25 23:33 ` kernel test robot
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=d2709848-3026-8104-adf2-bd28a74cc639@meta.com \
--to=yhs@meta.com \
--cc=jgg@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=yhs@fb.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