lkml.org 
[lkml]   [2014]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 07/30] cputime: Convert kcpustat to nsecs
On Fri, 28 Nov 2014 19:23:37 +0100
Frederic Weisbecker <fweisbec@gmail.com> wrote:

> Kernel cpu stats are stored in cputime_t which is an architecture
> defined type, and hence a bit opaque and requiring accessors and mutators
> for any operation.
>
> Converting them to nsecs simplifies the code a little bit.

Quite honestly I do not see much of an improvement here, on set of
functions (cputime_to_xxx) gets replaced by another (nsecs_to_xxx).

On the contrary for s390 I see a degradation, consider a hunk like
this:

> @@ -128,9 +128,9 @@ static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
>
> idle_time = cur_wall_time - busy_time;
> if (wall)
> - *wall = cputime_to_usecs(cur_wall_time);
> + *wall = div_u64(cur_wall_time, NSEC_PER_USEC);
>
> - return cputime_to_usecs(idle_time);
> + return div_u64(idle_time, NSEC_PER_USEC);
> }
>
> u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy)

For s390 cputime_to_usecs is a shift, with the new code we now have a division.
Fortunately this is in a piece of code that s390 does not use..

--
blue skies,
Martin.

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



\
 
 \ /
  Last update: 2014-12-01 15:41    [W:0.223 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site