提交 708f430d 编写于 作者: R Roland McGrath 提交者: Linus Torvalds

[PATCH] posix-cpu-timers: fix overrun reporting

This change corrects an omission in posix_cpu_timer_schedule, so that it
correctly propagates the overrun calculation to where it will get reported
to the user.
Signed-off-by: NRoland McGrath <roland@redhat.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 a241ec65
...@@ -1225,7 +1225,7 @@ void posix_cpu_timer_schedule(struct k_itimer *timer) ...@@ -1225,7 +1225,7 @@ void posix_cpu_timer_schedule(struct k_itimer *timer)
/* /*
* The task was cleaned up already, no future firings. * The task was cleaned up already, no future firings.
*/ */
return; goto out;
/* /*
* Fetch the current sample and update the timer's expiry time. * Fetch the current sample and update the timer's expiry time.
...@@ -1235,7 +1235,7 @@ void posix_cpu_timer_schedule(struct k_itimer *timer) ...@@ -1235,7 +1235,7 @@ void posix_cpu_timer_schedule(struct k_itimer *timer)
bump_cpu_timer(timer, now); bump_cpu_timer(timer, now);
if (unlikely(p->exit_state)) { if (unlikely(p->exit_state)) {
clear_dead_task(timer, now); clear_dead_task(timer, now);
return; goto out;
} }
read_lock(&tasklist_lock); /* arm_timer needs it. */ read_lock(&tasklist_lock); /* arm_timer needs it. */
} else { } else {
...@@ -1248,8 +1248,7 @@ void posix_cpu_timer_schedule(struct k_itimer *timer) ...@@ -1248,8 +1248,7 @@ void posix_cpu_timer_schedule(struct k_itimer *timer)
put_task_struct(p); put_task_struct(p);
timer->it.cpu.task = p = NULL; timer->it.cpu.task = p = NULL;
timer->it.cpu.expires.sched = 0; timer->it.cpu.expires.sched = 0;
read_unlock(&tasklist_lock); goto out_unlock;
return;
} else if (unlikely(p->exit_state) && thread_group_empty(p)) { } else if (unlikely(p->exit_state) && thread_group_empty(p)) {
/* /*
* We've noticed that the thread is dead, but * We've noticed that the thread is dead, but
...@@ -1257,8 +1256,7 @@ void posix_cpu_timer_schedule(struct k_itimer *timer) ...@@ -1257,8 +1256,7 @@ void posix_cpu_timer_schedule(struct k_itimer *timer)
* drop our task ref. * drop our task ref.
*/ */
clear_dead_task(timer, now); clear_dead_task(timer, now);
read_unlock(&tasklist_lock); goto out_unlock;
return;
} }
cpu_clock_sample_group(timer->it_clock, p, &now); cpu_clock_sample_group(timer->it_clock, p, &now);
bump_cpu_timer(timer, now); bump_cpu_timer(timer, now);
...@@ -1270,7 +1268,13 @@ void posix_cpu_timer_schedule(struct k_itimer *timer) ...@@ -1270,7 +1268,13 @@ void posix_cpu_timer_schedule(struct k_itimer *timer)
*/ */
arm_timer(timer, now); arm_timer(timer, now);
out_unlock:
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
out:
timer->it_overrun_last = timer->it_overrun;
timer->it_overrun = -1;
++timer->it_requeue_pending;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册