On Mon Jan 26, 2026 at 6:07 PM CET, Jason Gunthorpe wrote:
> On Mon, Jan 26, 2026 at 05:08:20PM +0100, Danilo Krummrich wrote:
>> Yes, the majority of uses is access(), not try_access(); not sure if rwsem is
>> the better solution though.
>
> rwsem is much faster on destroy and somewhat slower on read. Which
> sounds to match the use case here. Ie you wouldn't need to do special
> effort to bundle the synchronize_srcu()

While not that many, the try_access() cases may still be in hot paths, whereas
the destroy case is always in a cold path, i.e. device driver unbind. Also note
that if the resource is released "manually" before driver unbind, we use
revoke_nosync() as the destructor already guarantees that there are no more
users.

Reply via email to