diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2005-10-17 16:49:42 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-18 00:00:00 +0200 |
commit | 47d6b08334a43fafa61a587f721fa21ef65d81be (patch) | |
tree | 57e9082d0011a4ada210878be2b90c2ede14451a | |
parent | [PATCH] NFS: Fix Oopsable/unnecessary i_count manipulations in nfs_wait_on_in... (diff) | |
download | linux-47d6b08334a43fafa61a587f721fa21ef65d81be.tar.xz linux-47d6b08334a43fafa61a587f721fa21ef65d81be.zip |
[PATCH] posix-timers: fix task accounting
Make sure we release the task struct properly when releasing pending
timers.
release_task() does write_lock_irq(&tasklist_lock), so it can't race
with run_posix_cpu_timers() on any cpu.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | kernel/posix-cpu-timers.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index ad85d3f0dcc4..7a51a5597c33 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c @@ -424,6 +424,7 @@ static void cleanup_timers(struct list_head *head, cputime_t ptime = cputime_add(utime, stime); list_for_each_entry_safe(timer, next, head, entry) { + put_task_struct(timer->task); timer->task = NULL; list_del_init(&timer->entry); if (cputime_lt(timer->expires.cpu, ptime)) { @@ -436,6 +437,7 @@ static void cleanup_timers(struct list_head *head, ++head; list_for_each_entry_safe(timer, next, head, entry) { + put_task_struct(timer->task); timer->task = NULL; list_del_init(&timer->entry); if (cputime_lt(timer->expires.cpu, utime)) { @@ -448,6 +450,7 @@ static void cleanup_timers(struct list_head *head, ++head; list_for_each_entry_safe(timer, next, head, entry) { + put_task_struct(timer->task); timer->task = NULL; list_del_init(&timer->entry); if (timer->expires.sched < sched_time) { |