linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/4] [RFC] true vs. system idle cputime
@ 2008-10-08 16:19 Martin Schwidefsky
  2008-10-08 16:19 ` [patch 1/4] fix scaled & unscaled cputime accounting Martin Schwidefsky
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Martin Schwidefsky @ 2008-10-08 16:19 UTC (permalink / raw)
  To: linux-arch
  Cc: Heiko Carstens, Paul Mackerras, Benjamin Herrenschmidt,
	Hidetoshi Seto, Tony Luck, Jeremy Fitzhardinge, Chris Wright,
	Michael Neuling

Greetings,
while working on the analysis of a mismatch between the cputime accounting
numbers of z/VM as the host and Linux as the guest I started to wonder
about the accounting of idle time. z/VM showed more cpu time for the guest
as the guest itself. With the current code everything that the idle process
does is accounted as idle time. If idle is sleeping that is fine, but if
idle is actually using cpu cycles this is wrong.

The question is how wrong? To find out I've implemented really precise
accounting of true idle vs. system idle cputime for s390. A really simple
test that wakes up 100 times per second to do some minimal work before
going back to sleep showed 0.35% of system idle time. If you are dealing
with lots of virtual penguins this quickly becomes significant.

There are four patches in this series:
Patch #1: Cleanup scaled / unscaled cputime accounting
Patch #2: Change the accounting interface to allow the architectures to do
          precise idle time accounting
Patch #3: s390 patch to improve the precision of the idle_time_us value
Patch #4: s390 patch to implement improved idle time accounting

There is one change in patch #2 that might require a change on powerpc
and/or ia64. The generic TICK_ONESHOT/NO_HZ code calculates the number
of ticks spent with a disabled HZ timer and accounts this as idle time.
For a configuration for VIRT_CPU_ACCOUNTING=y this is horribly wrong.
Either you have precise accounting or you don't. Patch #2 just removes
the calculation for VIRT_CPU_ACCOUNTING=y. The architectures which support
precise accounting have to deal with it on their own. This is where the
powerpc and ia64 maintainer come into play. Would you look at patch #2
please ?

To make it clearer what happens in tick_nohz_restart_sched_tick I've added
a new function account_idle_ticks(). And for good measure another one named
account_steal_ticks() for xen where "interesting" things have been done
with the account_steal_time interface.

-- 
blue skies,
   Martin.

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-10-16  9:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08 16:19 [patch 0/4] [RFC] true vs. system idle cputime Martin Schwidefsky
2008-10-08 16:19 ` [patch 1/4] fix scaled & unscaled cputime accounting Martin Schwidefsky
2008-10-16  4:31   ` Paul Mackerras
2008-10-08 16:20 ` [patch 2/4] idle " Martin Schwidefsky
2008-10-16  4:59   ` Paul Mackerras
2008-10-16  6:42     ` Martin Schwidefsky
2008-10-16  9:08       ` Martin Schwidefsky
2008-10-08 16:20 ` [patch 3/4] improve precision of idle accounting Martin Schwidefsky
2008-10-08 16:20 ` [patch 4/4] improve idle cputime accounting Martin Schwidefsky
2008-10-08 21:22 ` [patch 0/4] [RFC] true vs. system idle cputime Luck, Tony
2008-10-09  8:03   ` Martin Schwidefsky
2008-10-15 14:01 ` Martin Schwidefsky
2008-10-15 20:56   ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).