[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240709133349.GC28495@redhat.com>
Date: Tue, 9 Jul 2024 15:33:49 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: mingo@...nel.org, andrii@...nel.org, linux-kernel@...r.kernel.org,
rostedt@...dmis.org, mhiramat@...nel.org, jolsa@...nel.org,
clm@...a.com, paulmck@...nel.org
Subject: Re: [PATCH 05/10] perf/uprobe: SRCU-ify uprobe->consumer list
On 07/09, Peter Zijlstra wrote:
>
> > + guard(srcu)(&uprobes_srcu);
> > +
> > + for_each_consumer_rcu(uc, uprobe->consumers) {
> > int rc = 0;
> >
> > if (uc->handler) {
> > @@ -2116,7 +2126,6 @@ static void handler_chain(struct uprobe
> > WARN_ON(!uprobe_is_active(uprobe));
> > unapply_uprobe(uprobe, current->mm);
>
> ^^^ this remove case needs more thought.
Yeah... that is why the current code doesn't use ->consumer_rwsem, iirc.
And consumer_add/del need some changes. Say, consumer_add() does
uc->next = uprobe->consumers;
uprobe->consumers = uc;
I guess it should do
WRITE_ONCE(uc->next, uprobe->consumers);
rcu_assign_pointer(uprobe->consumers, uc);
Oleg.
Powered by blists - more mailing lists