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") re-
introduced the problem addressed in 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 <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Eric Dumazet authored and torvalds committed Aug 21, 2012
1 parent ec5da7f commit f341861
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 f341861

Please sign in to comment.