All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: ftrace: preemptoff selftest not working
Date: Wed, 19 Nov 2008 10:23:54 +0100	[thread overview]
Message-ID: <20081119092354.GA5305@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20081119090223.GA25282@elte.hu>

On Wed, Nov 19, 2008 at 10:02:23AM +0100, Ingo Molnar wrote:
> 
> >  #ifdef CONFIG_FTRACE_STARTUP_TEST
> > +	/*
> > +	 * When this gets called we hold the BKL which means that preemption
> > +	 * is disabled. Various trace selftests however need to disable
> > +	 * and enable preemption for successful tests. So we drop the BKL here
> > +	 * and grab it after the tests again.
> > +	 */
> > +	unlock_kernel();
> >  	if (type->selftest) {
> >  		struct tracer *saved_tracer = current_trace;
> >  		struct trace_array *tr = &global_trace;
> > @@ -562,6 +569,7 @@ int register_tracer(struct tracer *type)
> >  		}
> >  		printk(KERN_CONT "PASSED\n");
> >  	}
> > +	lock_kernel();
> 
> dropping the BKL was a good idea, but the code flow was not 
> investigated thoroughly enough, which caused this crash to trigger in 
> -tip testing:

Yes, I came to the same conlcusion this morning after reading the patch
again and wanted to send a follow-up patch. But you were faster ;)

Anyway, what bothers me more is the question if the idea to drop the BKL
in register_tracer is good. It's probably just a question of time until
the first tracers come in modules. And then the unlock_kernel()/lock_kernel()
sequence would be broken.
So it probably might make more sense to drop and grab the BKL in the
init functions that register a tracer?

But.. maybe the BKL is gone until this is an issue ;)

      reply	other threads:[~2008-11-19  9:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-18 12:54 ftrace: preemptoff selftest not working Heiko Carstens
2008-11-18 13:48 ` Ingo Molnar
2008-11-18 13:49 ` Steven Rostedt
2008-11-18 13:52   ` Ingo Molnar
2008-11-18 14:32     ` Steven Rostedt
2008-11-18 14:47       ` Ingo Molnar
2008-11-18 17:06         ` Heiko Carstens
2008-11-18 17:21           ` Steven Rostedt
2008-11-18 20:55             ` Ingo Molnar
2008-11-19  9:02               ` Ingo Molnar
2008-11-19  9:23                 ` Heiko Carstens [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=20081119092354.GA5305@osiris.boeblingen.de.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=schwidefsky@de.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.