mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "Frédéric Weisbecker" <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Glauber de Oliveira Costa" <gcosta@redhat.com>,
	"Chris Wright" <chrisw@sous-sol.org>,
	"Jeremy Fitzhardinge" <jeremy@goop.org>,
	"Rusty Russell" <rusty@rustcorp.com.au>,
	"Pekka Enberg" <penberg@cs.helsinki.fi>
Subject: Re: [PATCH 0/2] [GIT PULL] tracing: various bug fixes
Date: Fri, 24 Apr 2009 10:34:44 +0200	[thread overview]
Message-ID: <20090424083444.GJ24912@elte.hu> (raw)
In-Reply-To: <alpine.DEB.2.00.0904230935060.24310@gandalf.stny.rr.com>


* Steven Rostedt <rostedt@goodmis.org> wrote:

> 
> On Thu, 23 Apr 2009, Ingo Molnar wrote:
> 
> > > 
> > > Here's the situation:
> > > 
> > > We've added selftests for the event tracer. What this basically does is 
> > > enables each event one at a time and runs tests. The tests include 
> > > creating a kernel thread, executing workqueues and grabbing locks.
> > > 
> > > We also have PROVE_LOCKING (LOCKDEP) enabled, that keeps track of 
> > > interrupts being enabled. When they are, we set a flag in the task struct 
> > > "hardirqs_enabled". When they are disabled, this flag is cleared.
> > > 
> > > When we fork a process, a test is made to see if the flag is set for the 
> > > new process and if it is not, a warning is printed (as is done in the 
> > > above dump).
> > > 
> > > I investigated this and found that the flag is mysteriously being set and 
> > > cleared for no apparent reason. The flag is in the task struct and nothing 
> > > should be touching it. In fact, it is a full int, not even a bit in a 
> > > flags variable.
> > > 
> > > I had a test that would print the flag and irqs_disabled() in copy_process 
> > > before the warning and it showed that the flag was cleared but irqs was 
> > > enabled. The funny part is, I if the test triggered, I printed the flag 
> > > again, and the second print it was set again!!
> > > 
> > > 	if (!p->hardirqs_enabled) {
> > > 		printk("irqs:%d flag:%d\n", irqs_disabled(),
> > > 			p->hardirqs_enabled);
> > > 		printk("try again: %d\n", p->hardirqs_enabled);
> > > 	}
> > > 
> > > The first print showed that it was cleared, the second showed it was set 
> > > again??
> > 
> > function tracer was active? So somewhere there we corrupted this 
> > state? It's unlikely that printk itself did this.
> 
> The problem always arises at the same spot. I'm not saying printk was the 
> culprit, I'm saying that printk actually "fixed" the issue. Which can be a 
> sign of a corrupted register somewhere.
> 
> I currently tracked it down to something in "prep_new_page". It is 
> hard to debug because as I add tests into the code, it makes the 
> race window smaller, and I need to run multiple boots to trigger 
> the code. But when I do trigger it (and I try to trigger it a few 
> times) it always happens at the same spot.
> 
> Note, everytime I catch the issue, the printk again "fixes" the 
> problem
> :-/

btw., you could perhaps use early_printk() - which is a lot less 
intrusive. It has no locking nor any irq-flags manipulation. (for 
the serial bits at least)

	Ingo

      parent reply	other threads:[~2009-04-24  8:36 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-20 22:22 Steven Rostedt
2009-04-20 22:22 ` [PATCH 1/2] tracing: use recursive counter over irq level Steven Rostedt
2009-04-20 22:22 ` [PATCH 2/2] tracing: use nowakeup version of commit for function event trace tests Steven Rostedt
2009-04-20 22:41   ` Frederic Weisbecker
2009-04-20 22:57     ` Steven Rostedt
2009-04-21  8:23 ` [PATCH 0/2] [GIT PULL] tracing: various bug fixes Ingo Molnar
2009-04-21  9:46   ` Ingo Molnar
2009-04-21 13:08     ` Steven Rostedt
2009-04-21 13:55     ` [PATCH][GIT PULL] ring-buffer: only warn on wrap if buffer is bigger than two pages Steven Rostedt
2009-04-21 14:35       ` Ingo Molnar
2009-04-21 14:54         ` Steven Rostedt
2009-04-21 16:22         ` Steven Rostedt
2009-04-21 14:03     ` [tip:tracing/core] " tip-bot for Steven Rostedt
2009-04-22  6:48     ` [PATCH 0/2] [GIT PULL] tracing: various bug fixes Steven Rostedt
2009-04-22 11:47       ` Frederic Weisbecker
2009-04-22 13:49         ` Steven Rostedt
2009-04-22 17:10           ` Frederic Weisbecker
2009-04-22 17:17             ` Jeremy Fitzhardinge
2009-04-22 17:22               ` Steven Rostedt
2009-04-22 21:32                 ` Steven Rostedt
2009-04-23  8:28                   ` Ingo Molnar
2009-04-23  3:35       ` Steven Rostedt
2009-04-23  8:20         ` Ingo Molnar
2009-04-23 13:53           ` Steven Rostedt
2009-04-23 14:39             ` Steven Rostedt
2009-04-23 15:08               ` Steven Rostedt
2009-04-23 15:11                 ` Ingo Molnar
2009-04-23 16:49                 ` Jeremy Fitzhardinge
2009-04-23 17:21                   ` Chris Wright
2009-04-23 18:02                     ` Chris Wright
2009-04-23 18:33                       ` Steven Rostedt
2009-04-23 18:43                         ` Chris Wright
2009-04-24  8:36                           ` Ingo Molnar
2009-04-24 15:12                             ` Chris Wright
2009-04-29  6:16                     ` [tip:tracing/core] x86: use native register access for native tlb flushing tip-bot for Chris Wright
2009-04-23 17:52                   ` [PATCH 0/2] [GIT PULL] tracing: various bug fixes Steven Rostedt
2009-04-24  8:34             ` Ingo Molnar [this message]

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=20090424083444.GJ24912@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=chrisw@sous-sol.org \
    --cc=fweisbec@gmail.com \
    --cc=gcosta@redhat.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    /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

Powered by JetHome