From: Li Zefan <lizf@cn.fujitsu.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: ltp-list@lists.sourceforge.net,
Peter Zijlstra <peterz@infradead.org>,
linuxppc-dev@lists.ozlabs.org,
LKML <linux-kernel@vger.kernel.org>,
Paul Mackerras <paulus@samba.org>,
Anton Blanchard <anton@samba.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [LTP] BUG: dead loop in PowerPC hcall tracepoint (Was: [PATCH v2] Add ftrace-stress-test to LTP)
Date: Tue, 19 Oct 2010 08:49:33 +0800 [thread overview]
Message-ID: <4CBCEB1D.7010101@cn.fujitsu.com> (raw)
In-Reply-To: <1287411903.16971.275.camel@gandalf.stny.rr.com>
Steven Rostedt wrote:
> On Mon, 2010-10-18 at 11:19 +0800, Li Zefan wrote:
>
>> This is a dead loop:
>>
>> trace_hcall_entry() -> trace_clock_global() -> trace_hcall_entry() ..
>>
>> And this is a PPC specific bug. Hope some ppc guys will fix it?
>> Or we kill trace_clock_global() if no one actually uses it..
>
> trace_clock_global() is used by many. I use it (and recommend using it)
> on boxes where the TSC is horribly out of sync, and the trace needs
> synchronization between CPUs.
>
> The trace_hcall_entry and exit has wrappers already. Just add recursion
> protection there.
>
Right, I thought of this. But as I have no machine to test, I'll leave
this to others.
> Perhaps something like this:
>
> (Not compiled nor ran)
>
> +static DEFINE_PER_CPU(hcall_trace_disable);
> +
> void hcall_tracepoint_regfunc(void)
> {
> hcall_tracepoint_refcount++;
> }
>
> void hcall_tracepoint_unregfunc(void)
> {
> hcall_tracepoint_refcount--;
> }
>
> +int __trace_disable_check(void)
> +{
> + if (!hcall_tracepoint_refcount)
> + return 1;
> +
> + if (get_cpu_var(hcall_trace_disable)) {
> + put_cpu_var(hcall_trace_disable);
> + return 1;
> + }
> +
> + __get_cpu_var(hcall_trace_disable)++;
> +
> + return 0;
> +}
> +
> +void __trace_disable_put(void)
> +{
> + __get_cpu_var(hcall_trace_disable)--;
> + put_cpu_var(hcall_trace_disable);
> +}
> +
> void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
> {
> + int trace_disable;
> +
> + if (__trace_disable_check())
> + return;
> +
> trace_hcall_entry(opcode, args);
> + __trace_disable_put();
> }
>
> void __trace_hcall_exit(long opcode, unsigned long retval,
> unsigned long *retbuf)
> {
> + if (__trace_disable_check())
> + return;
> +
> trace_hcall_exit(opcode, retval, retbuf);
> + __trace_disable_put();
> }
>
> -- Steve
>
>
>
>
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2010-10-19 0:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-07 2:50 [LTP] [PATCH v2] Add ftrace-stress-test to LTP Li Zefan
2010-09-28 16:05 ` Subrata Modak
2010-10-04 7:13 ` Subrata Modak
2010-10-13 7:21 ` Subrata Modak
2010-10-13 7:29 ` Li Zefan
2010-10-13 7:35 ` Li Zefan
2010-10-13 11:29 ` Li Zefan
2010-10-13 18:37 ` Subrata Modak
2010-10-13 19:01 ` Subrata Modak
2010-10-18 3:19 ` [LTP] BUG: dead loop in PowerPC hcall tracepoint (Was: [PATCH v2] Add ftrace-stress-test to LTP) Li Zefan
2010-10-18 10:05 ` Benjamin Herrenschmidt
2010-10-18 14:25 ` Steven Rostedt
2010-10-19 0:49 ` Li Zefan [this message]
2010-10-21 10:52 ` [LTP] [PATCH] powerpc: Fix hcall tracepoint recursion Anton Blanchard
2010-10-22 7:22 ` Li Zefan
2010-10-22 7:25 ` Subrata Modak
[not found] ` <20101101201256.66dc6dd7@kryten>
2010-11-02 18:46 ` Subrata Modak
2010-11-11 7:57 ` Subrata Modak
2010-10-22 14:14 ` 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=4CBCEB1D.7010101@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=anton@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ltp-list@lists.sourceforge.net \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--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