[lkml]   [2003]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: check cpu_online() in nr_running()
On Tue, 2003-02-25 at 16:33, William Lee Irwin III wrote:
>> for (i = 0; i < NR_CPUS; i++)
>> + if (!cpu_online(i))
>> + continue;
>> sum += cpu_rq(i)->nr_running;

On Tue, Feb 25, 2003 at 06:32:43PM +0000, Alan Cox wrote:
> I smell donkey poo 8)

I don't really like how this stuff got arranged either.

On Tue, Feb 25, 2003 at 06:32:43PM +0000, Alan Cox wrote:
> If the change is right, which seems reasonable then I think you
> need some { } 's too. Its also a hot path so it may be a lot
> cleaner to keep the jump out of this by just letting
> nr_running be zero for other processors ?

AFAICT its only usages are in /proc/ reporting and loadavg calculation,
which aren't hotpaths per-se, but shouldn't explode in complexity.
Similar things could be said for nr_uninterruptible() and nr_iowait(),
but some kind of unusual constraint is involved wrt. hotplug.

-- wli
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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