[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d5fbd49a-55c5-a9f5-6600-707c8d749312@linux.alibaba.com>
Date: Wed, 13 Oct 2021 16:11:10 +0800
From: ηθ΄ <yun.wang@...ux.alibaba.com>
To: Miroslav Benes <mbenes@...e.cz>
Cc: Guo Ren <guoren@...nel.org>, Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
Helge Deller <deller@....de>,
Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Jiri Kosina <jikos@...nel.org>, Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
Colin Ian King <colin.king@...onical.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Nicholas Piggin <npiggin@...il.com>,
Jisheng Zhang <jszhang@...nel.org>, linux-csky@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-parisc@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-riscv@...ts.infradead.org,
live-patching@...r.kernel.org
Subject: Re: [RESEND PATCH v2 1/2] ftrace: disable preemption between
ftrace_test_recursion_trylock/unlock()
On 2021/10/13 δΈε3:55, Miroslav Benes wrote:
>> diff --git a/include/linux/trace_recursion.h b/include/linux/trace_recursion.h
>> index a9f9c57..101e1fb 100644
>> --- a/include/linux/trace_recursion.h
>> +++ b/include/linux/trace_recursion.h
>> @@ -208,13 +208,29 @@ static __always_inline void trace_clear_recursion(int bit)
>> * Use this for ftrace callbacks. This will detect if the function
>> * tracing recursed in the same context (normal vs interrupt),
>> *
>> + * The ftrace_test_recursion_trylock() will disable preemption,
>> + * which is required for the variant of synchronize_rcu() that is
>> + * used to allow patching functions where RCU is not watching.
>> + * See klp_synchronize_transition() for more details.
>> + *
>
> I think that you misunderstood. Steven proposed to put the comment before
> ftrace_test_recursion_trylock() call site in klp_ftrace_handler().
Oh, I see... thanks for pointing out :-)
>
>> * Returns: -1 if a recursion happened.
[snip]
>> }
>
> Side note... the comment will eventually conflict with peterz's
> https://lore.kernel.org/all/20210929152429.125997206@infradead.org/.
Steven, would you like to share your opinion on this patch?
If klp_synchronize_transition() will be removed anyway, the comments
will be meaningless and we can just drop it :-P
Regards,
Michael Wang
>
> Miroslav
>
Powered by blists - more mailing lists