Re: [PATCH 2/2] sched: Lower chances of cputime scaling overflow

From: Frederic Weisbecker
Date: Wed Mar 13 2013 - 13:53:37 EST


2013/3/12 Frederic Weisbecker <fweisbec@xxxxxxxxx>:
> 2013/3/7 Stanislaw Gruszka <sgruszka@xxxxxxxxxx>:
>>> + } else if (!total) {
>>> stime = rtime;
>>
>> I would prefer stime = rtime/2 (hence utime will be rtime/2 too), but this
>> is not so important.
>
> I can do that.

I eventually kept it that way. Reason is that tasks always spend at
least a bit of time in the kernel when they are scheduled for the
first time. But they might never go to userspace, as in kernel
threads. So I prefer to stuff everything in stime by default. Having
(total == 0 && rtime != 0) should only happen for very low values of
rtime anyway.
--
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/