The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 0/4] [GIT PULL] tracing: recursion and compile fixes
Date: Mon, 20 Apr 2009 23:25:25 +0200	[thread overview]
Message-ID: <20090420212523.GA5997@nowhere> (raw)
In-Reply-To: <alpine.DEB.2.00.0904201711150.10097@gandalf.stny.rr.com>

On Mon, Apr 20, 2009 at 05:14:14PM -0400, Steven Rostedt wrote:
> 
> 
> On Mon, 20 Apr 2009, Frederic Weisbecker wrote:
> 
> > On Mon, Apr 20, 2009 at 04:44:46PM -0400, Steven Rostedt wrote:
> > > 
> > > On Mon, 20 Apr 2009, Frederic Weisbecker wrote:
> > > > > > 
> > > > > 
> > > > > Hmm, doesn't the trace wakeup test if the runqueue lock is locked or not?
> > > > > 
> > > > > -- Steve
> > > > > 
> > > > 
> > > > 
> > > > Hmm, yes it does but that's not the first time we meet this problem
> > > > (sched switch event tracing recursions by the past). So either the
> > > > test doesn't work well or this is about another lock that
> > > > wake_up_common takes...
> > > 
> > > Ug, it is the task's rq lock. Not the current rq lock. wakeup takes the 
> > > runqueue lock of the task. The "runqueue_is_locked" only tests the lock of 
> > > current CPU, which is not what we can have.
> > 
> > 
> > You mean the lock held on the wait_queue for wake_up_trace() ?
> > 
> > void __wake_up(wait_queue_head_t *q, unsigned int mode,
> > 			int nr_exclusive, void *key)
> > {
> > 	unsigned long flags;
> > 
> > 	spin_lock_irqsave(&q->lock, flags);
> > 	__wake_up_common(q, mode, nr_exclusive, 0, key);
> > 	spin_unlock_irqrestore(&q->lock, flags);
> > }
> > 
> 
> No, I mean that we check the runqueue lock on the current CPU (there's a 
> runqueue for each CPU). The runqueue_is_locked tests only the lock for the 
> current cpu. But the wake up of a task grabs the runqueue of the lock the 
> task is on.
> 
> If we are on CPU0 and hold the runqueue lock of CPU1, and we wake up a 
> task on CPU1, we will deadlock. Even thought runqueue_is_locked passed. 
> Because the current runqueue lock is not part of this equation.


Oh I see :-/
And of course the check of every rq lock is not conceivable wrt the hot path
and in term of scalability.

 
> -- Steve
> 


  reply	other threads:[~2009-04-20 21:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-20 17:38 [PATCH 0/4] [GIT PULL] tracing: recursion and compile fixes Steven Rostedt
2009-04-20 17:38 ` [PATCH 1/4] tracing/events: call the correct event trace selftest init function Steven Rostedt
2009-04-20 17:38 ` [PATCH 2/4] tracing: remove dangling semicolon Steven Rostedt
2009-04-20 17:38 ` [PATCH 3/4] tracing: fix recursive test level calculation Steven Rostedt
2009-04-20 19:30   ` Andrew Morton
2009-04-20 17:38 ` [PATCH 4/4] tracing: remove recursive test from ring_buffer_event_discard Steven Rostedt
2009-04-20 17:55 ` [PATCH 0/4] [GIT PULL] tracing: recursion and compile fixes Ingo Molnar
2009-04-20 19:28   ` Ingo Molnar
2009-04-20 19:45     ` Frederic Weisbecker
2009-04-20 19:53       ` Steven Rostedt
2009-04-20 20:17       ` Steven Rostedt
2009-04-20 20:33         ` Frederic Weisbecker
2009-04-20 20:44           ` Steven Rostedt
2009-04-20 21:01             ` Frederic Weisbecker
2009-04-20 21:14               ` Steven Rostedt
2009-04-20 21:25                 ` Frederic Weisbecker [this message]
2009-04-20 19:29   ` Ingo Molnar
2009-04-20 19:43     ` Steven Rostedt
2009-04-20 19:48       ` Frederic Weisbecker
2009-04-20 19:55       ` 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=20090420212523.GA5997@nowhere \
    --to=fweisbec@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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