[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250715142610.2e1bb341@batman.local.home>
Date: Tue, 15 Jul 2025 14:26:10 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Steven Rostedt <rostedt@...nel.org>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, bpf@...r.kernel.org, x86@...nel.org,
Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, Josh Poimboeuf <jpoimboe@...nel.org>,
Ingo Molnar <mingo@...nel.org>, Jiri Olsa <jolsa@...nel.org>, Namhyung Kim
<namhyung@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, Andrii
Nakryiko <andrii@...nel.org>, Indu Bhagat <indu.bhagat@...cle.com>, "Jose
E. Marchesi" <jemarch@....org>, Beau Belgrave <beaub@...ux.microsoft.com>,
Jens Remus <jremus@...ux.ibm.com>, Linus Torvalds
<torvalds@...ux-foundation.org>, Andrew Morton <akpm@...ux-foundation.org>,
Jens Axboe <axboe@...nel.dk>, Florian Weimer <fweimer@...hat.com>, Sam
James <sam@...too.org>
Subject: Re: [PATCH v13 10/14] unwind: Clear unwind_mask on exit back to
user space
On Tue, 15 Jul 2025 14:06:50 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> > > > + * Return: 0 if the callback successfully was queued.
> > > > + * UNWIND_ALREADY_PENDING if the the callback was already queued.
> > > > + * UNWIND_ALREADY_EXECUTED if the callback was already called
> > > > + * (and will not be called again)
> > > > * Negative if there's an error.
> > > > * @cookie holds the cookie of the first request by any user
> > > > */
> > >
> > > Lots of babbling in the Changelog, but no real elucidation as to why you
> > > need this second return value.
> > >
> > > AFAICT it serves no real purpose; the users of this function should not
> > > care. The only difference is that the unwind reference (your cookie)
> > > becomes a backward reference instead of a forward reference. But why
> > > would anybody care?
> >
> > Older versions of the code required it. I think I can remove it now.
>
> Ah it is still used in the perf code:
>
> perf_callchain() has:
>
> if (defer_user) {
> int ret = deferred_request(event);
> if (!ret)
> local_inc(&event->ctx->nr_no_switch_fast);
Hmm, I guess this could work if it returned non zero for both already
queued and already executed. So it doesn't need to be two different
values.
-- Steve
> else if (ret < 0)
> defer_user = false;
> }
Powered by blists - more mailing lists