From: Peter Zijlstra <peterz@infradead•org>
To: Steven Rostedt <rostedt@goodmis•org>
Cc: 王贇 <yun.wang@linux•alibaba.com>,
"Paul Walmsley" <paul.walmsley@sifive•com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership•com>,
"Paul Mackerras" <paulus@samba•org>,
"Jisheng Zhang" <jszhang@kernel•org>,
"H. Peter Anvin" <hpa@zytor•com>,
live-patching@vger•kernel.org, linux-riscv@lists•infradead.org,
"Miroslav Benes" <mbenes@suse•cz>,
"Joe Lawrence" <joe.lawrence@redhat•com>,
"Helge Deller" <deller@gmx•de>,
x86@kernel•org, linux-csky@vger•kernel.org,
"Ingo Molnar" <mingo@redhat•com>,
"Petr Mladek" <pmladek@suse•com>,
"Albert Ou" <aou@eecs•berkeley.edu>,
"Jiri Kosina" <jikos@kernel•org>,
"Nicholas Piggin" <npiggin@gmail•com>,
"Borislav Petkov" <bp@alien8•de>,
"Josh Poimboeuf" <jpoimboe@redhat•com>,
"Thomas Gleixner" <tglx@linutronix•de>,
linux-parisc@vger•kernel.org, LKML <linux-kernel@vger•kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt•com>,
"Masami Hiramatsu" <mhiramat@kernel•org>,
"Guo Ren" <guoren@kernel•org>,
"Colin Ian King" <colin.king@canonical•com>,
linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH] tracing: Have all levels of checks prevent recursion
Date: Fri, 15 Oct 2021 20:24:59 +0200 [thread overview]
Message-ID: <20211015182459.GL174703@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20211015142033.72605b47@gandalf.local.home>
On Fri, Oct 15, 2021 at 02:20:33PM -0400, Steven Rostedt wrote:
> On Fri, 15 Oct 2021 20:04:29 +0200
> Peter Zijlstra <peterz@infradead•org> wrote:
>
> > On Fri, Oct 15, 2021 at 01:58:06PM -0400, Steven Rostedt wrote:
> > > Something like this:
> >
> > I think having one copy of that in a header is better than having 3
> > copies. But yes, something along them lines.
>
> I was just about to ask you about this patch ;-)
Much better :-)
> diff --git a/kernel/events/internal.h b/kernel/events/internal.h
> index 228801e20788..c91711f20cf8 100644
> --- a/kernel/events/internal.h
> +++ b/kernel/events/internal.h
> @@ -206,11 +206,7 @@ DEFINE_OUTPUT_COPY(__output_copy_user, arch_perf_out_copy_user)
> static inline int get_recursion_context(int *recursion)
> {
> unsigned int pc = preempt_count();
Although I think we can do without that ^ line as well :-)
> - unsigned char rctx = 0;
> -
> - rctx += !!(pc & (NMI_MASK));
> - rctx += !!(pc & (NMI_MASK | HARDIRQ_MASK));
> - rctx += !!(pc & (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET));
> + unsigned char rctx = interrupt_context_level();
>
> if (recursion[rctx])
> return -1;
next prev parent reply other threads:[~2021-10-15 18:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 15:00 [PATCH] tracing: Have all levels of checks prevent recursion Steven Rostedt
2021-10-15 16:17 ` Peter Zijlstra
2021-10-15 17:35 ` Steven Rostedt
2021-10-15 17:58 ` Steven Rostedt
2021-10-15 18:04 ` Peter Zijlstra
2021-10-15 18:20 ` Steven Rostedt
2021-10-15 18:24 ` Peter Zijlstra [this message]
2021-10-15 19:00 ` Steven Rostedt
2021-10-15 18:25 ` Steven Rostedt
2023-07-21 15:34 ` Alexander Lobakin
2023-07-21 16:00 ` Steven Rostedt
2023-07-21 16:06 ` Alexander Lobakin
2023-07-21 16:26 ` Steven Rostedt
2023-07-22 1:22 ` Jakub Kicinski
2021-10-18 10:19 ` Petr Mladek
2021-10-18 13:50 ` Steven Rostedt
2021-10-18 15:09 ` Petr Mladek
2021-10-19 2:02 ` Steven Rostedt
2021-10-19 6:41 ` Petr Mladek
2021-10-19 13:00 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211015182459.GL174703@worktop.programming.kicks-ass.net \
--to=peterz@infradead$(echo .)org \
--cc=James.Bottomley@HansenPartnership$(echo .)com \
--cc=aou@eecs$(echo .)berkeley.edu \
--cc=bp@alien8$(echo .)de \
--cc=colin.king@canonical$(echo .)com \
--cc=deller@gmx$(echo .)de \
--cc=guoren@kernel$(echo .)org \
--cc=hpa@zytor$(echo .)com \
--cc=jikos@kernel$(echo .)org \
--cc=joe.lawrence@redhat$(echo .)com \
--cc=jpoimboe@redhat$(echo .)com \
--cc=jszhang@kernel$(echo .)org \
--cc=linux-csky@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-parisc@vger$(echo .)kernel.org \
--cc=linux-riscv@lists$(echo .)infradead.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=live-patching@vger$(echo .)kernel.org \
--cc=mbenes@suse$(echo .)cz \
--cc=mhiramat@kernel$(echo .)org \
--cc=mingo@redhat$(echo .)com \
--cc=npiggin@gmail$(echo .)com \
--cc=palmer@dabbelt$(echo .)com \
--cc=paul.walmsley@sifive$(echo .)com \
--cc=paulus@samba$(echo .)org \
--cc=pmladek@suse$(echo .)com \
--cc=rostedt@goodmis$(echo .)org \
--cc=tglx@linutronix$(echo .)de \
--cc=x86@kernel$(echo .)org \
--cc=yun.wang@linux$(echo .)alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox