From: Avi Kivity <avi@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: kvm@vger.kernel.org, Gleb Natapov <gleb@redhat.com>
Subject: Re: [PATCH] KVM guest: prevent tracing recursion with kvmclock
Date: Tue, 15 Nov 2011 15:45:34 +0200 [thread overview]
Message-ID: <4EC26CFE.8010406@redhat.com> (raw)
In-Reply-To: <1321364308.4181.7.camel@frodo>
On 11/15/2011 03:38 PM, Steven Rostedt wrote:
> On Tue, 2011-11-15 at 15:01 +0200, Avi Kivity wrote:
> > Stop tracing when we read the clock, since tracing will also
> > want to read the clock, and recurse indefinitely.
>
> I would rephrase the above. You don't actually stop tracing, you just
> don't trace the preempt disable. I would reword that to something like:
>
> Prevent tracing of preempt_disable() in get_cpu_var() in
> kvm_clock_read(). When CONFIG_DEBUG_PREEMPT is enabled,
> preempt_disable/enable() are traced and this causes the function_graph
> tracer to go into an infinite recursion. By open coding the
> preempt_disable() around the get_cpu_var(), we can use the notrace
> version which prevents preempt_disable/enable() from being traced and
> prevents the recursion.
>
> Something like the above.
Thanks, I adopted your wording.
> >
> > Based on a similar patch for Xen from Jeremy Fitzhardinge.
> >
> > Signed-off-by: Avi Kivity <avi@redhat.com>
>
> This was exactly my first thought, but I was thinking it may be better
> to have a get_cpu_var_notrace() than to have to open code this stuff.
> Maybe there's not that many users that open code is not an issue. I'll
> still want to add that recursion protection with the warn on though.
>
What about function traces? Will any noninlined calls cause the same
problem?
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2011-11-15 13:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-15 13:01 [PATCH] KVM guest: prevent tracing recursion with kvmclock Avi Kivity
2011-11-15 13:12 ` Gleb Natapov
2011-11-15 13:38 ` Steven Rostedt
2011-11-15 13:45 ` Avi Kivity [this message]
2011-11-15 14:01 ` 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=4EC26CFE.8010406@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.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