diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-10-10 18:27:19 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2013-12-09 10:53:50 -0500 |
commit | e26d70d271ee1a68a925796b411cb0239394c7a1 (patch) | |
tree | 128a1600c93b2c5e9be2e2358feec1cf27170f90 | |
parent | d430b9173a9a50a83e10d1c70baead3e625b522f (diff) |
posix-timers: Cleanup reaped target handling
When a timer's target is seen to be buried, for example on calls
to timer_gettime(), the posix cpu timers code behaves a bit
like a garbage collector and releases early the reference to the
task.
Then again, this optimization complicates the code for no much
value: it's up to the user to release the timer and its associated
ressources by calling timer_delete() after it buries the target
tasks.
Remove this to simplify the code.
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>
-rw-r--r-- | kernel/posix-cpu-timers.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index c5d1ef530268..dc4355b967db 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c | |||
@@ -639,8 +639,6 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int flags, | |||
639 | */ | 639 | */ |
640 | if (unlikely(p->sighand == NULL)) { | 640 | if (unlikely(p->sighand == NULL)) { |
641 | read_unlock(&tasklist_lock); | 641 | read_unlock(&tasklist_lock); |
642 | put_task_struct(p); | ||
643 | timer->it.cpu.task = NULL; | ||
644 | return -ESRCH; | 642 | return -ESRCH; |
645 | } | 643 | } |
646 | 644 | ||
@@ -808,8 +806,6 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp) | |||
808 | * We can't even collect a sample any more. | 806 | * We can't even collect a sample any more. |
809 | * Call the timer disarmed, nothing else to do. | 807 | * Call the timer disarmed, nothing else to do. |
810 | */ | 808 | */ |
811 | put_task_struct(p); | ||
812 | timer->it.cpu.task = NULL; | ||
813 | timer->it.cpu.expires = 0; | 809 | timer->it.cpu.expires = 0; |
814 | read_unlock(&tasklist_lock); | 810 | read_unlock(&tasklist_lock); |
815 | goto dead; | 811 | goto dead; |
@@ -1059,8 +1055,6 @@ void posix_cpu_timer_schedule(struct k_itimer *timer) | |||
1059 | * The process has been reaped. | 1055 | * The process has been reaped. |
1060 | * We can't even collect a sample any more. | 1056 | * We can't even collect a sample any more. |
1061 | */ | 1057 | */ |
1062 | put_task_struct(p); | ||
1063 | timer->it.cpu.task = p = NULL; | ||
1064 | timer->it.cpu.expires = 0; | 1058 | timer->it.cpu.expires = 0; |
1065 | read_unlock(&tasklist_lock); | 1059 | read_unlock(&tasklist_lock); |
1066 | goto out; | 1060 | goto out; |