Re: [PATCH v2 1/3] gpio: mpsse: use rcu to ensure worker is torn down
From: Linus Walleij
Date: Wed Oct 01 2025 - 18:51:39 EST
On Wed, Oct 1, 2025 at 5:07 PM Mary Strodl <mstrodl@xxxxxxxxxxx> wrote:
> With that said, I think now that I've found spinlocks work, I could use those
> to gate access to the list everywhere, and use the standard lists api rather
> than the RCU lists api. Obviously teardown of the workers would happen outside
> the spin lock critical section, guarded by a proper mutex.
Yeah RCU is for massive parallelism where you have a lot of (performance
sensitive) readers and a few writers to the struct.
If this isn't performance-sensitive and doesn't have a *lot* of simultaneous
readers, try to use simpler locking mechanisms if you can.
But if performance hampers, RCU is surely the way to go!
Yours,
Linus Walleij