lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 May 2009 10:10:36 +0200
From:	Martin Schwidefsky <schwidefsky@...ibm.com>
To:	Jan Engelhardt <jengelh@...ozas.de>
Cc:	Michael Abbott <michael@...neidae.co.uk>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Re: /proc/uptime idle counter remains at 0

On Mon, 11 May 2009 09:42:03 +0200 (CEST)
Jan Engelhardt <jengelh@...ozas.de> wrote:

> 
> On Monday 2009-05-11 09:35, Martin Schwidefsky wrote:
> >> I have to confess I don't really understand the logic of what's going on 
> >> here -- in particular, what does the idle process do other than account 
> >> for time when the processor has nothing useful to do?  It does seem to me 
> >> now that the .utime and .stime fields are now less than useful -- maybe 
> >> they can be deleted now?
> >
> >The idle task does not just sleep, it will do "real" work, e.g. softirq
> >handling for interrupts / network traffic.
> 
> With an RT kernel, SIRQ and such are separate tasks. That should also
> be play a role while 0 is displayed.

With an RT kernel there still is a tiny amount of system work in idle,
that is the instruction executed to switch to the idle process, go to
sleep, wake up again and switch back to another process.

> >> I've always assumed that the second field of /proc/uptime was a simple 
> >> measure of time not spent doing real work, in other words a crude measure 
> >> of spare CPU resources.  My instrument basically uses the the two fields 
> >> of this file to compute a measure of CPU loading so it can raise an alert 
> >> if the CPU doesn't have enough spare (idle) capacity.
> >
> >But it wasn't.. the old style stime of idle is a mixture of true idle
> >time and some system time.
> 
> Then I would say let's show the idle time only (but still inculde
> the idle time when the CPU is halted).

That is hard to do. I've implemented this for s390 where the idle time
really is the time spent waiting. To improve x86 with its tick based
accounting you need to find out if the timer interrupt arrived while
the cpu has been waiting, e.g. check the instruction pointed to by eip
for "hlt".

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ