Re: [PATCH v3 11/19] unwind: Add deferred user space unwinding API
From: Josh Poimboeuf
Date: Tue Oct 29 2024 - 13:05:37 EST
On Tue, Oct 29, 2024 at 02:49:18PM +0100, Peter Zijlstra wrote:
> On Mon, Oct 28, 2024 at 02:47:38PM -0700, Josh Poimboeuf wrote:
>
> > +static void unwind_user_task_work(struct callback_head *head)
> > +{
> ...
> > + guard(rwsem_read)(&callbacks_rwsem);
> > +
> > + for_each_set_bit(i, &pending, UNWIND_MAX_CALLBACKS) {
> > + if (callbacks[i])
> > + callbacks[i]->func(&trace, cookie, privs[i]);
> > + }
>
> I'm fairly sure people will come with pitchforks for that read-lock
> there. They scale like shit on big systems. Please use SRCU or somesuch.
I'd expect that unwind_user_{register,unregister}() would only be called
once per tracing component during boot so there wouldn't be any
contention.
But I think I can make SRCU work here.
--
Josh