Messages in this thread | | | Date | Wed, 19 Nov 2008 10:23:54 +0100 | From | Heiko Carstens <> | Subject | Re: ftrace: preemptoff selftest not working |
| |
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 ;)
| |