Re: [PATCH] process cputimer is moving faster than its corresponding clock

Peter Zijlstra
2013-04-12T10:50:41Z

On Wed, 2013-04-10 at 11:48 -0400, Olivier Langlois wrote:
>
> You have valid concerns and I will attempt to clarify the changes I
> propose. Before I do, realise that as a first time patcher, I
> sincerely
> attempted to minimize the changes required to fix the posix cputimers.

Right, I suspect some of that is what made me go yuck! when reading the
patch. I feel some interfaces could be avoided if we refactor a bit
more -- and given the complexity of the code its well worth doing.

> The real source of the problem is that the process clock is distinct
> from its cputimer. It is not explained why it is done like that in the
> code but I understand that the benefit is that you can fetch the
> cputimer value and avoiding the cost to traverse the list of tasks
> member of the group. The price to pay however it is that it is painful
> to make sure that the clock and its corresponding cputimer remain in
> sync as they advance. With that in mind, I did all I can to minimize
> thread group task list traversal when possible and do it only when
> mandatory which is when you set a timer expiration time.

Right, I hope my earlier email explained why it is so expensive and
thus why they're separated.

I'll try and dig through the rest of your email later.. sorry for being
a tad slow etc.