]> git.baikalelectronics.ru Git - kernel.git/commit
posix-cpu-timers: don't account cpu timer after stopped thread runtime accounting
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Sun, 26 May 2013 21:35:41 +0000 (17:35 -0400)
committerFrederic Weisbecker <fweisbec@gmail.com>
Thu, 4 Jul 2013 16:02:30 +0000 (18:02 +0200)
commitb1a47633c05414dbae3170c622bc791e7ff2da6a
treeaa51270ce1fcc53f2547571b615a53e4e1bce464
parent6249aa2dfbdb7fdfd314d5604ec4f19a0d0ba0cb
posix-cpu-timers: don't account cpu timer after stopped thread runtime accounting

When tsk->signal->cputimer->running is 1, signal->cputimer (i.e. per process
timer account) and tsk->sum_sched_runtime (i.e. per thread timer account)
increase at the same pace because update_curr() increases both accounting.

However, there is one exception. When thread exiting, __exit_signal() turns
over task's sum_shced_runtime to sig->sum_sched_runtime, but it doesn't stop
signal->cputimer accounting.

This inconsistency makes POSIX timer wake up too early. This patch fixes it.

Original-patch-by: Olivier Langlois <olivier@trillion01.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
kernel/sched/stats.h