From: Frederic Weisbecker <fweisbec@gmail.com>
To: Vaibhav Nagarnaik <vnagarnaik@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>, Michael Rubin <mrubin@google.com>,
David Sharp <dhsharp@google.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] tracing: Don't call wakeup() when committing the event
Date: Wed, 4 May 2011 01:35:06 +0200 [thread overview]
Message-ID: <20110503233503.GH2678@nowhere> (raw)
In-Reply-To: <BANLkTikRxY_NiNG+z+t_BDwDAom_rpNmdg@mail.gmail.com>
On Tue, May 03, 2011 at 04:27:22PM -0700, Vaibhav Nagarnaik wrote:
> On Tue, May 3, 2011 at 4:08 PM, Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > On Tue, May 03, 2011 at 06:47:32PM -0400, Steven Rostedt wrote:
> >> On Wed, 2011-05-04 at 00:09 +0200, Frederic Weisbecker wrote:
> >>
> >> > I wonder if we should have a lite version of wake_up() that checks
> >> > if the list of waiters is empty before locking the queue.
> >> > After all we don't care much about tight races for tracing.
> >>
> >> Since tracing is a special case here, we probably could get away to just
> >> do it ourselves. That is, have our own flag that determines if we should
> >> wakeup or not.
> >
> > Yep, agreed.
> >
> How about this? Check if the waitqueue is active and if true, operate on the
> trace_wait queue.
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 06f4458..e03ee24 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -353,7 +353,7 @@ void trace_wake_up(void)
> {
> int cpu;
>
> - if (trace_flags & TRACE_ITER_BLOCK)
> + if (trace_flags & TRACE_ITER_BLOCK || !waitqueue_active(&trace_wait))
> return;
> /*
> * The runqueue_is_locked() can fail, but this is the best we
>
Hehe, seems it should work :)
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
next prev parent reply other threads:[~2011-05-03 23:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-03 21:03 [RFC PATCH] tracing: Don't call wakeup() when committing the event Vaibhav Nagarnaik
2011-05-03 21:41 ` Frederic Weisbecker
2011-05-03 21:56 ` Vaibhav Nagarnaik
2011-05-03 22:09 ` Frederic Weisbecker
2011-05-03 22:47 ` Steven Rostedt
2011-05-03 23:08 ` Frederic Weisbecker
2011-05-03 23:27 ` Vaibhav Nagarnaik
2011-05-03 23:35 ` Frederic Weisbecker [this message]
2011-05-04 0:14 ` Vaibhav Nagarnaik
2011-05-03 23:36 ` Vaibhav Nagarnaik
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=20110503233503.GH2678@nowhere \
--to=fweisbec@gmail.com \
--cc=dhsharp@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mrubin@google.com \
--cc=rostedt@goodmis.org \
--cc=vnagarnaik@google.com \
/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