From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: paulmck@kernel.org
Cc: Bradley Morgan <brads@mainlining.org>,
linux-kernel@vger.kernel.org,
kernel test robot <yi1.lai@intel.com>,
Boqun Feng <boqun@kernel.org>,
rcu@vger.kernel.org, lkmm@lists.linux.dev
Subject: Re: [PATCH] hazptr: handle NULL address in hazptr_detach
Date: Tue, 8 Sep 2026 12:53:52 -0400 [thread overview]
Message-ID: <21b63f08-e79b-4eb9-9922-77a61d5ffa7c@efficios.com> (raw)
In-Reply-To: <da21c929-cd85-4ecb-8976-5948f080b6e7@paulmck-laptop>
On 2026-09-08 12:22, Paul E. McKenney wrote:
> On Tue, Sep 08, 2026 at 11:29:31AM -0400, Mathieu Desnoyers wrote:
>> On 2026-09-08 11:24, Bradley Morgan wrote:
>>> On 8 September 2026 16:22:14 BST, Mathieu Desnoyers
>>> <mathieu.desnoyers@efficios.com> wrote:
>>>> When hazptr_acquire loads a NULL pointer, it sets:
>>>>
>>>> - slot_item->slot.addr = NULL,
>>>> - slot_item->ctx.ctx = ctx
>>>> - ctx->slot = slot
>>>>
>>>> And it returns NULL.
>>>>
>>>> Then hazptr_detach is called on this ctx, it will act on the ctx as if
>>>> needed to be promoted to backup slot, even though it has a NULL addr.
>>>>
>>>> Looking at what hazptr_note_context_switch() does before promoting
>>>> to backup slot, it checks for a NULL slot->addr, which is exactly
>>>> what is missing from hazptr_detach.
>>>>
>>>> With this in place there would be no need to explicitly check the
>>>> hazptr_acquire() return value before calling hazptr_detach().
>>>>
>>>> hazptr_release() has a early return check for NULL addr as well, so it
>>>> makes sense that detach does an early return (no-op) similarly.
>>>>
>>>
>>> You shall kill me for this!!
>>>
>>> Could you perhaps do a splat in ze commit description pls?
>>
>> The splat is available at the "Closes" URL below. I'm not sure whether
>> we should duplicate this verbose information ?
>>
>> Paul ?
>
> I am fine either way, as long as the information is reasonably easily
> accessible. Which is the case either way. ;-)
Then I favor a concise commit message, leaving the splat details to the
"Closes" link. Feel free to pick up this patch for testing.
Thank you!
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
next prev parent reply other threads:[~2026-09-08 16:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 15:22 Mathieu Desnoyers
2026-09-08 15:24 ` Bradley Morgan
2026-09-08 15:29 ` Mathieu Desnoyers
2026-09-08 15:52 ` Bradley Morgan
2026-09-08 16:22 ` Paul E. McKenney
2026-09-08 16:31 ` Bradley Morgan
2026-09-08 16:53 ` Mathieu Desnoyers [this message]
2026-09-10 3:14 ` Paul E. McKenney
2026-09-10 2:16 ` kernel test robot
2026-09-10 3:11 ` Paul E. McKenney
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=21b63f08-e79b-4eb9-9922-77a61d5ffa7c@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=boqun@kernel.org \
--cc=brads@mainlining.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkmm@lists.linux.dev \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=yi1.lai@intel.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®