Re: [PATCH 3/3] sched,time: atomically increment stime & utime

2014-08-16 Thread Oleg Nesterov
Aaah, Rik, I am sorry! You documented this in 0/3 which I didn't bother to read. Sorry for noise. On 08/16, Oleg Nesterov wrote: > > On 08/15, r...@redhat.com wrote: > > > > --- a/kernel/sched/cputime.c > > +++ b/kernel/sched/cputime.c > > @@ -605,9 +605,12 @@ static void cputime_adjust(struct

Re: [PATCH 3/3] sched,time: atomically increment stime & utime

2014-08-16 Thread Oleg Nesterov
On 08/15, r...@redhat.com wrote: > > --- a/kernel/sched/cputime.c > +++ b/kernel/sched/cputime.c > @@ -605,9 +605,12 @@ static void cputime_adjust(struct task_cputime *curr, >* If the tick based count grows faster than the scheduler one, >* the result of the scaling may go

Re: [PATCH 3/3] sched,time: atomically increment stime utime

2014-08-16 Thread Oleg Nesterov
On 08/15, r...@redhat.com wrote: --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -605,9 +605,12 @@ static void cputime_adjust(struct task_cputime *curr, * If the tick based count grows faster than the scheduler one, * the result of the scaling may go backward.

Re: [PATCH 3/3] sched,time: atomically increment stime utime

2014-08-16 Thread Oleg Nesterov
Aaah, Rik, I am sorry! You documented this in 0/3 which I didn't bother to read. Sorry for noise. On 08/16, Oleg Nesterov wrote: On 08/15, r...@redhat.com wrote: --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -605,9 +605,12 @@ static void cputime_adjust(struct

[PATCH 3/3] sched,time: atomically increment stime & utime

2014-08-15 Thread riel
From: Rik van Riel The functions task_cputime_adjusted and thread_group_cputime_adjusted can be called locklessly, as well as concurrently on many different CPUs. This can occasionally lead to the utime and stime reported by times(), and other syscalls like it, going backward. The cause for

[PATCH 3/3] sched,time: atomically increment stime utime

2014-08-15 Thread riel
From: Rik van Riel r...@redhat.com The functions task_cputime_adjusted and thread_group_cputime_adjusted can be called locklessly, as well as concurrently on many different CPUs. This can occasionally lead to the utime and stime reported by times(), and other syscalls like it, going backward.