All of lore.kernel.org
 help / color / mirror / Atom feed
* check cpu_online() in nr_running()
@ 2003-02-25 16:33 William Lee Irwin III
  2003-02-25 18:32 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: William Lee Irwin III @ 2003-02-25 16:33 UTC (permalink / raw)
  To: linux-kernel

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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-02-25 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-25 16:33 check cpu_online() in nr_running() William Lee Irwin III
2003-02-25 18:32 ` Alan Cox
2003-02-25 17:51   ` William Lee Irwin III

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.