lkml.org 
[lkml]   [2012]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 3/3] cputime: Consolidate cputime adjustment code
From
2012/11/25 Paul Gortmaker <paul.gortmaker@windriver.com>:
>> --- a/include/linux/sched.h
>> +++ b/include/linux/sched.h
>> @@ -433,6 +433,11 @@ struct cpu_itimer {
>> u32 incr_error;
>> };
>>
>> +struct cputime {
>> + cputime_t utime;
>> + cputime_t stime;
>> +};
>> +
>
> Hi Frederic,
>
> This new struct cputime is a 2/3 subset of the three variable struct
> task_cputime we see right below. Maybe this is a stupid question, but I
> was wondering why you didn't re-use task_cputime, and ignore the
> sum_exec_runtime field -- vs. introducing this very similar struct?

Not a stupid question, I need to add a comment on that. I avoided to
reuse struct task_cputime because sum_exec_runtime is unused and 8
wasted bytes in the middle of task_struct is very undesirable. As in
signal struct.

>
> Or maybe there is another way to consolidate the structs? With the
> two being so similar, I wonder if it will be confusing when to use which
> one of the two.

I can add a comment that tells when to use which. Other than that I'm
short on ideas to consolidate both without creating a mess with long
dereferencing expressions like tsk->cputime.utime and so.


\
 
 \ /
  Last update: 2012-11-26 02:01    [W:0.086 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site