Re: Incorrect CPU process accounting using CONFIG_HZ=100

From: Con Kolivas
Date: Wed Jun 28 2006 - 21:08:47 EST


Peter Williams writes:

Con Kolivas wrote:
Peter Williams writes:

Al Boldi wrote:
Peter Williams wrote:

twice:
1. for external proc monitoring, using a probed approach
2. for scheduling, using an inlined approach

Not exactly (e.g. there's no separation between user and sys time available in line) but the possibilities are there.


Wouldn't merging the two approaches be in the interest of conserving cpu resources, while at the same time reflecting an accurate view of cpu utilization?

I think that this would be a worthwhile endeavour once/if sched_clock() is fixed. This is especially the case as CPUs get faster as many tasks may run to completion in less than a tick.

That may not be as simple as it seems. To properly account system v user time using the sched_clock we'd have to hook into arch dependant asm code to know when entering and exiting kernel context. That is far more invasive than the simple on/off runqueue timing we currently do for scheduling accounting.

Yes, it is a problem and we may have to do something approximate like counting ticks for sys time and subtracting that from the total to get user time when reporting the times to user space (only a bit more complex to make sure we don't end up with negative times).

How is it intended to handle this problem in the tickless kernel?

The tickless name is a misnomer. The implemenation I had and the one that tglx/mingo are maintaining still tick but they skip idle ticks. This means that all we need to do is add the number of skipped idle ticks whenever we tick to the idle count.

--
-ck

Attachment: pgp00000.pgp
Description: PGP signature