diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/posix-cpu-timers.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index 4ebd8ad07c66..c7f31aa272f7 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c | |||
@@ -404,14 +404,8 @@ static void cleanup_timers_list(struct list_head *head, | |||
404 | { | 404 | { |
405 | struct cpu_timer_list *timer, *next; | 405 | struct cpu_timer_list *timer, *next; |
406 | 406 | ||
407 | list_for_each_entry_safe(timer, next, head, entry) { | 407 | list_for_each_entry_safe(timer, next, head, entry) |
408 | list_del_init(&timer->entry); | 408 | list_del_init(&timer->entry); |
409 | if (timer->expires < curr) { | ||
410 | timer->expires = 0; | ||
411 | } else { | ||
412 | timer->expires -= curr; | ||
413 | } | ||
414 | } | ||
415 | } | 409 | } |
416 | 410 | ||
417 | /* | 411 | /* |
@@ -459,15 +453,21 @@ void posix_cpu_timers_exit_group(struct task_struct *tsk) | |||
459 | tsk->se.sum_exec_runtime + sig->sum_sched_runtime); | 453 | tsk->se.sum_exec_runtime + sig->sum_sched_runtime); |
460 | } | 454 | } |
461 | 455 | ||
462 | static void clear_dead_task(struct k_itimer *timer, unsigned long long now) | 456 | static void clear_dead_task(struct k_itimer *itimer, unsigned long long now) |
463 | { | 457 | { |
458 | struct cpu_timer_list *timer = &itimer->it.cpu; | ||
459 | |||
464 | /* | 460 | /* |
465 | * That's all for this thread or process. | 461 | * That's all for this thread or process. |
466 | * We leave our residual in expires to be reported. | 462 | * We leave our residual in expires to be reported. |
467 | */ | 463 | */ |
468 | put_task_struct(timer->it.cpu.task); | 464 | put_task_struct(timer->task); |
469 | timer->it.cpu.task = NULL; | 465 | timer->task = NULL; |
470 | timer->it.cpu.expires -= now; | 466 | if (timer->expires < now) { |
467 | timer->expires = 0; | ||
468 | } else { | ||
469 | timer->expires -= now; | ||
470 | } | ||
471 | } | 471 | } |
472 | 472 | ||
473 | static inline int expires_gt(cputime_t expires, cputime_t new_exp) | 473 | static inline int expires_gt(cputime_t expires, cputime_t new_exp) |