I noticed a few people complaining about cat /proc/uptime showing wrong idle
time since 1.3.77 and rightly so. After looking at kernel/sched.c one can
easily notice that in update_process_times() there is a
if ( p->pid )
.....
update_one_process(p, ticks, ticks-system, system);
This code does not allow swapper (pid = 0) to have its utime/stime to be
updated properly. So, if you comment out the if() /proc/uptime will work.
Well, I am not sure if this is the correct fix because the person who put
the if(p->pid) in update_process_times() obviously had some reasons to do
so. So, can someone more knowledgeable than myself tell me if I am wrong
or right?
Thanks alot,
Tigran. (bs_s641@ceres.king.ac.uk)
--------------------------------------------------------------------------
Please send your replies to bs_s641@ceres.king.ac.uk no matter what you
see in "From:" or "Reply-To:" fields. Thank you.
--------------------------------------------------------------------------