diff options
author | Rik van Riel <[email protected]> | 2014-08-15 16:05:38 -0400 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2014-09-08 08:17:02 +0200 |
commit | eb1b4af0a64ac7bb0ee36f579c1c7cefcbc3ac2c (patch) | |
tree | b8a48561d5a51a5b5249d987f1ecfa97a0a44fbc /tools/perf/scripts/python | |
parent | e78c3496790ee8a36522a838b59b388e8a709e65 (diff) |
sched, time: Atomically increment stime & utime
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 this appears to be
multiple threads racing in cputime_adjust(), both with values for utime or
stime that is larger than the original, but each with a different value.
Sometimes the larger value gets saved first, only to be immediately
overwritten with a smaller value by another thread.
Using atomic exchange prevents that problem, and ensures time
progresses monotonically.
Signed-off-by: Rik van Riel <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions