lkml.org 
[lkml]   [2003]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectcheck cpu_online() in nr_running()
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;
-
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:33    [W:0.029 / U:7.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site