aboutsummaryrefslogtreecommitdiff
path: root/kernel/time/posix-cpu-timers.c
AgeCommit message (Collapse)AuthorFilesLines
2014-11-16sched/cputime: Fix cpu_timer_sample_group() double accountingPeter Zijlstra1-1/+1
While looking over the cpu-timer code I found that we appear to add the delta for the calling task twice, through: cpu_timer_sample_group() thread_group_cputimer() thread_group_cputime() times->sum_exec_runtime += task_sched_runtime(); *sample = cputime.sum_exec_runtime + task_delta_exec(); Which would make the sample run ahead, making the sleep short. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Stanislaw Gruszka <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Tejun Heo <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2014-09-08time, signal: Protect resource use statistics with seqlockRik van Riel1-14/+0
Both times() and clock_gettime(CLOCK_PROCESS_CPUTIME_ID) have scalability issues on large systems, due to both functions being serialized with a lock. The lock protects against reporting a wrong value, due to a thread in the task group exiting, its statistics reporting up to the signal struct, and that exited task's statistics being counted twice (or not at all). Protecting that with a lock results in times() and clock_gettime() being completely serialized on large systems. This can be fixed by using a seqlock around the events that gather and propagate statistics. As an additional benefit, the protection code can be moved into thread_group_cputime(), slightly simplifying the calling functions. In the case of posix_cpu_clock_get_task() things can be simplified a lot, because the calling function already ensures that the task sticks around, and the rest is now taken care of in thread_group_cputime(). This way the statistics reporting code can run lockless. Signed-off-by: Rik van Riel <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Alex Thorlton <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Daeseok Youn <[email protected]> Cc: David Rientjes <[email protected]> Cc: Dongsheng Yang <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Guillaume Morin <[email protected]> Cc: Ionut Alexa <[email protected]> Cc: Kees Cook <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Li Zefan <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Michal Schmidt <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Vladimir Davydov <[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]>
2014-06-23time/timers: Move all time(r) related files into kernel/timeThomas Gleixner1-0/+1490
Except for Kconfig.HZ. That needs a separate treatment. Signed-off-by: Thomas Gleixner <[email protected]>