[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLguPcQFauCX5Wfp@krava>
Date: Wed, 3 Sep 2025 14:02:05 +0200
From: Jiri Olsa <olsajiri@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
x86@...nel.org, Song Liu <songliubraving@...com>,
Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
Hao Luo <haoluo@...gle.com>, Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH perf/core 01/11] uprobes: Add unique flag to uprobe
consumer
On Wed, Sep 03, 2025 at 12:49:33PM +0200, Oleg Nesterov wrote:
> On 09/02, Jiri Olsa wrote:
> >
> > +static bool consumer_can_add(struct list_head *head, struct uprobe_consumer *uc)
> > +{
> > + /* Uprobe has no consumer, we can add any. */
> > + if (list_empty(head))
> > + return true;
> > + /* Uprobe has consumer/s, we can't add unique one. */
> > + if (uc->is_unique)
> > + return false;
> > + /*
> > + * Uprobe has consumer/s, we can add nother consumer only if the
> > + * current consumer is not unique.
> > + **/
> > + return !list_first_entry(head, struct uprobe_consumer, cons_node)->is_unique;
> > +}
>
> Since you are going to send V2 anyway... purely cosmetic and subjective nit,
> but somehow I can't resist,
>
> bool consumer_can_add(struct list_head *head, struct uprobe_consumer *new)
> {
> struct uprobe_consumer *old = list_first_entry_or_null(...);
>
> return !old || (!old->exclusive && !new->exclusive);
> }
>
> looks a bit more readable to me. Please ignore if you like your version more.
yep, looks better, thanks
jirka
Powered by blists - more mailing lists