Skip to content

Commit

Permalink
task_work: add a scheduling point in task_work_run()
Browse files Browse the repository at this point in the history
It seems commit 4a9d4b0 (switch fput to task_work_add) reintroduced
the problem addressed in commit 944be0b (close_files(): add scheduling
point)

If a server process with a lot of files (say 2 million tcp sockets)
is killed, we can spend a lot of time in task_work_run() and trigger
a soft lockup.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Eric Dumazet authored and Al Viro committed Aug 22, 2012
1 parent 5585263 commit 88ec278
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/task_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ void task_work_run(void)
p = q->next;
q->func(q);
q = p;
cond_resched();
}
}
}

0 comments on commit 88ec278

Please sign in to comment.