[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2024100538-acquire-imprecise-ecee@gregkh>
Date: Sat, 5 Oct 2024 10:43:04 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Boqun Feng <boqun.feng@...il.com>, paulmck <paulmck@...nel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: Hazard pointer enabled refcount prototype
On Fri, Oct 04, 2024 at 03:52:01PM -0400, Mathieu Desnoyers wrote:
> 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.
How could it be used with RCU? I'll have to look into that, but thanks
for the links and I'll dig into this on Monday to see if I could use
these to get rid of the "static mutex" pattern that almost all drivers
need to have these days (which in turn will mean we will not need to use
that in new rust drivers either, which will make them simpler as well
because the static mutex pattern in rust is rough to make work.)
thanks,
greg k-h
Powered by blists - more mailing lists