LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Zdenek Kabelac <zdenek.kabelac@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: sys_sched_yield keeps locked irq before call of schedule()
Date: Thu, 6 Nov 2008 08:46:39 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.1.10.0811060845340.31011@gandalf.stny.rr.com> (raw)
In-Reply-To: <20081106075754.GE8459@elte.hu>


On Thu, 6 Nov 2008, Ingo Molnar wrote:
> 
> * Zdenek Kabelac <zdenek.kabelac@gmail.com> wrote:
> 
> > > is this some special warning you added? The stock kernel certainly 
> > > does not emit this warning.
> > 
> > Yes - it's my personal debug checker that tries to watch wether irq 
> > & irqsafe are running in pair. So it shows a warning if there is a 
> > call of spin_lock_irq and irq is already dissabled.
> 
> btw., i have added lockdep instrumentation for this two years ago, 
> it's in the upstream kernel:
> 
> /proc/lockdep_stats: redundant hardirq ons:                7744
> /proc/lockdep_stats: redundant hardirq offs:            1873736
> /proc/lockdep_stats: redundant softirq ons:                   0
> /proc/lockdep_stats: redundant softirq offs:                  0
> 
> you could extend the code to trace it. See 
> kernel/lockdep.c:trace_hardirqs_on_caller(). This bit does it:
> 
>         if (unlikely(curr->hardirqs_enabled)) {
>                 debug_atomic_inc(&redundant_hardirqs_on);
>                 return;
>         }
> 
> you could add a ftrace_printk("redundant hardirq") call right there, 
> enable ftrace, and enable stack tracing of each trace entry:

Quick note. Currently ftrace_printk only shows up if it is set in the 
iter_ctrl.

  echo trace_printk > /debug/tracing/iter_ctrl

I'll send out a patch to have it on by default.

-- Steve

> 
>  echo stacktrace > /debug/tracing/iter_ctrl
> 
> then you should see all the call sites in /debug/tracing/trace.
> 
> 	Ingo
> 
> 

  reply	other threads:[~2008-11-06 13:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05 12:57 Zdenek Kabelac
2008-11-05 13:01 ` Ingo Molnar
2008-11-05 13:09   ` Zdenek Kabelac
2008-11-05 14:05     ` Arnd Bergmann
2008-11-05 14:37       ` Zdenek Kabelac
2008-11-06  7:57     ` Ingo Molnar
2008-11-06 13:46       ` Steven Rostedt [this message]
2008-11-06 14:34         ` Ingo Molnar
2008-11-06 14:46           ` 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=alpine.DEB.1.10.0811060845340.31011@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=zdenek.kabelac@gmail.com \
    --subject='Re: sys_sched_yield keeps locked irq before call of schedule()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).