diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-10-11 10:11:43 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2013-12-09 10:53:50 -0500 |
commit | af82eb3c3068877a6b1989796a06b846b1e9e1c3 (patch) | |
tree | 993d789a777e97675e4c7f03e5a79f1e9b49c3e7 /kernel/posix-cpu-timers.c | |
parent | a3222f88fa4f2ebec4632aef527dd2c9a41b997d (diff) |
posix-timers: Remove useless clock sample on timers cleanup
a0b2062b0904ef07944c4a6e4d0f88ee44f1e9f2
("posix_timers: fix racy timer delta caching on task exit") forgot
to remove the arguments used for timer caching.
Fix this leftover.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Kosaki Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel/posix-cpu-timers.c')
-rw-r--r-- | kernel/posix-cpu-timers.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index ab9911b54faf..e6389f915bcb 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c | |||
@@ -399,8 +399,7 @@ static int posix_cpu_timer_del(struct k_itimer *timer) | |||
399 | return ret; | 399 | return ret; |
400 | } | 400 | } |
401 | 401 | ||
402 | static void cleanup_timers_list(struct list_head *head, | 402 | static void cleanup_timers_list(struct list_head *head) |
403 | unsigned long long curr) | ||
404 | { | 403 | { |
405 | struct cpu_timer_list *timer, *next; | 404 | struct cpu_timer_list *timer, *next; |
406 | 405 | ||
@@ -414,16 +413,11 @@ static void cleanup_timers_list(struct list_head *head, | |||
414 | * time for later timer_gettime calls to return. | 413 | * time for later timer_gettime calls to return. |
415 | * This must be called with the siglock held. | 414 | * This must be called with the siglock held. |
416 | */ | 415 | */ |
417 | static void cleanup_timers(struct list_head *head, | 416 | static void cleanup_timers(struct list_head *head) |
418 | cputime_t utime, cputime_t stime, | ||
419 | unsigned long long sum_exec_runtime) | ||
420 | { | 417 | { |
421 | 418 | cleanup_timers_list(head); | |
422 | cputime_t ptime = utime + stime; | 419 | cleanup_timers_list(++head); |
423 | 420 | cleanup_timers_list(++head); | |
424 | cleanup_timers_list(head, cputime_to_expires(ptime)); | ||
425 | cleanup_timers_list(++head, cputime_to_expires(utime)); | ||
426 | cleanup_timers_list(++head, sum_exec_runtime); | ||
427 | } | 421 | } |
428 | 422 | ||
429 | /* | 423 | /* |
@@ -433,24 +427,14 @@ static void cleanup_timers(struct list_head *head, | |||
433 | */ | 427 | */ |
434 | void posix_cpu_timers_exit(struct task_struct *tsk) | 428 | void posix_cpu_timers_exit(struct task_struct *tsk) |
435 | { | 429 | { |
436 | cputime_t utime, stime; | ||
437 | |||
438 | add_device_randomness((const void*) &tsk->se.sum_exec_runtime, | 430 | add_device_randomness((const void*) &tsk->se.sum_exec_runtime, |
439 | sizeof(unsigned long long)); | 431 | sizeof(unsigned long long)); |
440 | task_cputime(tsk, &utime, &stime); | 432 | cleanup_timers(tsk->cpu_timers); |
441 | cleanup_timers(tsk->cpu_timers, | ||
442 | utime, stime, tsk->se.sum_exec_runtime); | ||
443 | 433 | ||
444 | } | 434 | } |
445 | void posix_cpu_timers_exit_group(struct task_struct *tsk) | 435 | void posix_cpu_timers_exit_group(struct task_struct *tsk) |
446 | { | 436 | { |
447 | struct signal_struct *const sig = tsk->signal; | 437 | cleanup_timers(tsk->signal->cpu_timers); |
448 | cputime_t utime, stime; | ||
449 | |||
450 | task_cputime(tsk, &utime, &stime); | ||
451 | cleanup_timers(tsk->signal->cpu_timers, | ||
452 | utime + sig->utime, stime + sig->stime, | ||
453 | tsk->se.sum_exec_runtime + sig->sum_sched_runtime); | ||
454 | } | 438 | } |
455 | 439 | ||
456 | static inline int expires_gt(cputime_t expires, cputime_t new_exp) | 440 | static inline int expires_gt(cputime_t expires, cputime_t new_exp) |