From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org
Subject: check cpu_online() in nr_running()
Date: Tue, 25 Feb 2003 08:33:35 -0800 [thread overview]
Message-ID: <20030225163335.GD10396@holomorphy.com> (raw)
nr_uninterruptible() and nr_iowait() both check cpu_online(cpu) as
cpu ranges from 0 to NR_CPUS-1; so should nr_running().
-- wli
diff -urpN linux-2.5.63/kernel/sched.c nr_running-2.5.63-1/kernel/sched.c
--- linux-2.5.63/kernel/sched.c Thu Feb 20 20:33:52 2003
+++ nr_running-2.5.63-1/sched.c Tue Feb 25 08:23:09 2003
@@ -637,6 +637,8 @@
unsigned long i, sum = 0;
for (i = 0; i < NR_CPUS; i++)
+ if (!cpu_online(i))
+ continue;
sum += cpu_rq(i)->nr_running;
return sum;
next reply other threads:[~2003-02-25 16:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-25 16:33 William Lee Irwin III [this message]
2003-02-25 18:32 ` Alan Cox
2003-02-25 17:51 ` William Lee Irwin III
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=20030225163335.GD10396@holomorphy.com \
--to=wli@holomorphy.com \
--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®