From: Roland Dreier <roland@digitalvampire.org>
To: Jesper Juhl <juhl-lkml@dif.dk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Linux 2.6.0-test8 __might_sleep warnings on boot
Date: 19 Oct 2003 12:17:23 -0700 [thread overview]
Message-ID: <874qy5ox4s.fsf@love-shack.home.digitalvampire.org> (raw)
In-Reply-To: <Pine.LNX.4.56.0310190349090.7420@jju_lnx.backbone.dif.dk>
>>>>> " " == 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
next prev parent reply other threads:[~2003-10-19 19:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-18 21:38 Roland Dreier
2003-10-18 23:14 ` Andrew Morton
2003-10-19 0:11 ` Roland Dreier
2003-10-19 0:21 ` Andrew Morton
2003-10-19 1:19 ` Roland Dreier
2003-10-19 1:53 ` Jesper Juhl
2003-10-19 19:17 ` Roland Dreier [this message]
2003-10-20 8:28 ` Jesper Juhl
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=874qy5ox4s.fsf@love-shack.home.digitalvampire.org \
--to=roland@digitalvampire.org \
--cc=juhl-lkml@dif.dk \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®