taskstats: use real microsecond granularity for CPU times

The taskstats interface uses microsecond granularity for the user and
system time values.  The conversion from cputime to the taskstats values
uses the cputime_to_msecs primitive which effectively limits the
granularity to milliseconds.  Add the cputime_to_usecs primitive for
architectures that have better, more precise CPU time values.  Remove
cputime_to_msecs primitive because there are no more users left.

Signed-off-by: Michael Holzheu <[email protected]>
Acked-by: Balbir Singh <[email protected]>
Cc: Luck Tony <[email protected]>
Cc: Shailabh Nagar <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Shailabh Nagar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Michael Holzheu 2010-10-27 15:34:45 -07:00 • committed by Linus Torvalds
commit d57af9b214
5 changed files with 21 additions and 23 deletions

View file

@ -73,18 +73,18 @@ cputime64_to_jiffies64(cputime64_t cputime)
}
/*
* Convert cputime to milliseconds and back.
* Convert cputime to microseconds and back.
*/
static inline unsigned int
cputime_to_msecs(const cputime_t cputime)
cputime_to_usecs(const cputime_t cputime)
{
return cputime_div(cputime, 4096000);
return cputime_div(cputime, 4096);
}
static inline cputime_t
msecs_to_cputime(const unsigned int m)
usecs_to_cputime(const unsigned int m)
{
return (cputime_t) m * 4096000;
return (cputime_t) m * 4096;
}
/*