On Tue, May 06, 2014 at 03:24:13PM +0530, Preeti Murthy wrote: > Hi Morten, Peter, Alex, > > In a similar context, I noticed that /proc/loadavg makes use of > avenrun[] array which keeps track of the history of the global > load average. This however makes use of the sum of > nr_running + nr_uninterruptible per cpu. Why are we not > using the cpu_load[] array here which also keeps track > of the history of per-cpu load and then return a sum of it?
Entirely different kind of 'load'. Note that you cannot use ->nr_uninterruptible per-cpu, also note that sched/proc.c doesn't. > Using nr_running to show the global load average would > be misleading when entire load balancing is being done on the > basis of the history of cfs_rq->runnable_load_avg/cpu_load[] > right? IOW, to the best of my understanding we do not use > nr_running anywhere to directly determine cpu load in the kernel. > > My idea was that the global/per_cpu load that we reflect via > proc/sys interfaces must be consistent. I haven't really > looked at what /proc/schedstat, /proc/stat, top are all reading > from. But /proc/loadavg is reading out global nr_running + > waiting tasks when this will not give us the accurate picture > of the system load especially when there are many short running > tasks. Nobody said /proc/loadavg is a sane number, but its what it is and since its a global number its entirely unsuited for balancing -- not to mention all other reasons its crap.
pgp2OMRvllLdx.pgp
Description: PGP signature