2007-10-18 16:14:04

by Srivatsa Vaddagiri

[permalink] [raw]
Subject: Buggy idle time reported in /proc/uptime for SMP systems?

The idle time reported in /proc/uptime (2nd field) seems to be the idle
time of only CPU0. Shouldn't it reflect the total idle time on a SMP system?
Do folks agree that it is a bug that needs to be fixed? If so, will send
a patch ...

Fyi, I see patches submitted to fix this way back in 2001
[http://lkml.org/lkml/2001/3/17/55], but don't think they made in ..

--
Regards,
vatsa


2007-10-18 19:04:22

by Srivatsa Vaddagiri

[permalink] [raw]
Subject: Re: Buggy idle time reported in /proc/uptime for SMP systems?

On Thu, Oct 18, 2007 at 09:55:13PM +0530, Srivatsa Vaddagiri wrote:
> The idle time reported in /proc/uptime (2nd field) seems to be the idle
> time of only CPU0. Shouldn't it reflect the total idle time on a SMP system?
> Do folks agree that it is a bug that needs to be fixed? If so, will send
> a patch ...

On further reflection, it doesn't sound buggy. Reporting idle time across all
cpus in /proc/uptime will cause idle time > uptime, which will be odd. I
guess if anyone wants strict idle time from all cpus, they can always
look at /proc/stat.

> Fyi, I see patches submitted to fix this way back in 2001
> [http://lkml.org/lkml/2001/3/17/55], but don't think they made in ..

--
Regards,
vatsa