mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Boqun Feng <boqun.feng@gmail.com>, paulmck <paulmck@kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Hazard pointer enabled refcount prototype
Date: Fri, 4 Oct 2024 15:52:01 -0400	[thread overview]
Message-ID: <3b749585-1286-4a4e-acd0-1534b60172da@efficios.com> (raw)

Hi Greg,

After our discussion at KR2024, I've created a prototype adding hazard pointer
dereference support to refcount.h:

https://github.com/compudj/linux-dev/commit/234523dc9be90f1bc9221bf2d430c9187ac61528

Branch: https://github.com/compudj/linux-dev/tree/hp-6.11-refcount

It allows dereferencing a pointer to a refcount and incrementing the refcount,
without relying on RCU.

A good candidate for this would be the "usblp" driver which is using a static mutex
for existence guarantees. Introducing a refcount as first field of struct usblp
should do the trick.

I am not entirely sure if this kind of use-case justifies introducing hazard pointers
though, as this can be done just as well with RCU. I'll let you be the judge on this.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

             reply	other threads:[~2024-10-04 19:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 19:52 Mathieu Desnoyers [this message]
2024-10-05  8:43 ` Greg Kroah-Hartman
2024-10-05 15:01   ` Mathieu Desnoyers

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=3b749585-1286-4a4e-acd0-1534b60172da@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=boqun.feng@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    /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®