Re: [PATCH 1/1] cputime: Make the reported utime+stime correspond to the actual runtime.

From: Fredrik MarkstrÃm
Date: Sat Jun 13 2015 - 07:18:36 EST


Resending beause it bounced of linux-kernel (google inbox sends
everything as html) !

Thanks for your quick response, I'll elaborate on the Changelog.

Regarding the global spinlock I considered adding it to task_struct
and signal_struct. My reasoning not to do it, flawed or not, was that
I thought the risk for congestion and cache line bouncing would be
small given the following assumptions:
1. As far as I understand neither of the callers are typically called
very frequently. (procfs, k_getrusage, wait_task_zombie and sys_times)
2 The and the time spent in the lock region is small.

Did I have bad luck when thinking :) or do you still think it's better
to add the locks to the structs above ?

/Fredrik

On Fri, Jun 12, 2015 at 12:16 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Fri, 2015-06-12 at 10:55 +0200, Fredrik Markstrom wrote:
>> The scaling mechanism might sometimes cause top to report >100%
>> (sometimes > 1000%) cpu usage for a single thread. This patch makes
>> sure that stime+utime corresponds to the actual runtime of the thread.
>
> This Changelog is inadequate, it does not explain the actual problem.
>
>> +static DEFINE_SPINLOCK(prev_time_lock);
>
> global (spin)locks are bad.



--
/Fredrik
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/