[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <7c86c4470907280151p13e275c0q27a51897351e8e0@mail.gmail.com>
Date: Tue, 28 Jul 2009 10:51:04 +0200
From: stephane eranian <eranian@...glemail.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: perfmon2-devel <perfmon2-devel@...ts.sourceforge.net>,
Maynard Johnson <mpjohn@...ibm.com>,
Robert Richter <robert.richter@....com>,
LKML <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Paul Mackerras <paulus@...ba.org>, Carl Love <cel@...ibm.com>,
Corey J Ashford <cjashfor@...ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Philip Mucci <mucci@...s.utk.edu>,
Dan Terpstra <terpstra@...s.utk.edu>,
Ingo Molnar <mingo@...e.hu>
Subject: Re: perf_counters issue with self-sampling threads
[Reposting the message because of stupid MIME-encoding error on my part]
Andi,
Looks like SIGPROF is calling _group_send_sig_info(), so I
think it is subject to the same problem.
I have built a perfmon example to test the problem, it is
relatively easy to trigger by simply self-monitoring a thread
which is using setitimer() and thus SIGALRM. You just have
to increase the timer frequency. At some point, the SIGPROF
signal will be delivered to the wrong thread.
One thing I did not mention in my message is that one would think
that forcing a specific signal via F_SETSIG could be a workaround
if that signal is synchronous, e.g., SIGFPE. F_SETSIG looks like a
Linux extension but it does not solve the problem. Linux determines
the mode of delivery not on the signal number but on the code path,
it seems. If you use F_ASYNC+F_SETOWN, then this is systematically
considered asynchronous regardless of the signal used.If you come from
traps.c, then the signal is delivered to the correct thread. All of this does
not look unreasonable to me.
I believe sampling, be it timer or PMU-based, may be
a special case here. We want asynchronous + specific
thread (only) when self- sampling.
An alternative may be to choose the pending queue based on the signal type
(synchronous, asynchronous). Then, we could use F_SETSIG to override
SIGIO with a synchronous signal instead. But I am not a POSIX signal expert.
On Jul 27, 2009 11:25 PM, "Andi Kleen" <andi@...stfloor.org> wrote:
I wonder how SIGPROF gets around the same problem, or is it
buggy too?
-Andi
--
ak@...ux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists