lkml.org 
[lkml]   [2003]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Linux 2.6.0-test8 __might_sleep warnings on boot
From
Date
>>>>> " " == Jesper Juhl <juhl-lkml@dif.dk> writes:

> On Sun, 18 Oct 2003, Roland Dreier wrote:
>
> > - if (in_atomic() || irqs_disabled()) {
> > + /* Don't print warnings until system_running is set. This avoids
> > + spurious warnings during boot before local_irq_enable() and
> > + init_idle(). */
> > + if (system_running && (in_atomic() || irqs_disabled())) {
>
> Wouldn't this :
>
> if ((in_atomic() || irqs_disabled()) && system_running)
>
> be slightly more efficient? The reason I say that is that I would assume
> that the chance of (in_atomic() || irqs_disabled()) being false is greater
> than the chance of !system_running - if that is so, then reordering the if
> will allow it to break out early more often...

Yes, I think you're right about the efficiency. However, I didn't
think this was a performance-critical code path (especially since it
is only turned on by a debugging config option), and the way I wrote
it matched the way I was thinking about the test ("If the system is
running, then check if we're in atomic or have irqs disabled").
But I don't think it matters much either way.

Thanks,
Roland
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.044 / U:1.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site