From: 王贇 <yun.wang@linux.alibaba.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
open list <linux-kernel@vger.kernel.org>,
Jiri Olsa <jolsa@redhat.com>
Subject: Re: [RESEND PATCH v2] trace: prevent preemption in perf_ftrace_function_call()
Date: Mon, 11 Oct 2021 17:39:32 +0800 [thread overview]
Message-ID: <87aeef5b-c457-d4df-8abf-f9f035d73dbc@linux.alibaba.com> (raw)
In-Reply-To: <YWP6W7Be0Yp6egsn@hirez.programming.kicks-ass.net>
On 2021/10/11 下午4:48, Peter Zijlstra wrote:
> On Mon, Oct 11, 2021 at 10:32:46AM +0200, Peter Zijlstra wrote:
>> diff --git a/include/linux/trace_recursion.h b/include/linux/trace_recursion.h
>> index a9f9c5714e65..ca12e2d8e060 100644
>> --- a/include/linux/trace_recursion.h
>> +++ b/include/linux/trace_recursion.h
>> @@ -214,7 +214,14 @@ static __always_inline void trace_clear_recursion(int bit)
>> static __always_inline int ftrace_test_recursion_trylock(unsigned long ip,
>> unsigned long parent_ip)
>> {
>> - return trace_test_and_set_recursion(ip, parent_ip, TRACE_FTRACE_START, TRACE_FTRACE_MAX);
>> + bool ret;
>> +
>> + preempt_disable_notrace();
>> + ret = trace_test_and_set_recursion(ip, parent_ip, TRACE_FTRACE_START, TRACE_FTRACE_MAX);
>> + if (!ret)
>> + preempt_enable_notrace();
>> +
>> + return ret;
>> }
>>
>> /**
>
> Oh, I might've gotten that wrong, I assumed regular trylock semantics,
> but it doesn't look like that's right.
I will use bit instead ret and give some testing :-)
BTW, would you prefer to merge these changes into this patch or maybe send
another patch with your suggested-by?
Regards,
Michael Wang
>
next prev parent reply other threads:[~2021-10-11 9:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 3:12 王贇
2021-10-09 0:03 ` Steven Rostedt
2021-10-11 2:38 ` 王贇
2021-10-11 8:32 ` Peter Zijlstra
2021-10-11 8:48 ` Peter Zijlstra
2021-10-11 9:39 ` 王贇 [this message]
2021-10-11 14:45 ` Peter Zijlstra
2021-10-12 5:51 ` 王贇
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=87aeef5b-c457-d4df-8abf-f9f035d73dbc@linux.alibaba.com \
--to=yun.wang@linux.alibaba.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®