Skip to content

Commit 88ec278

Browse files
edumazetAl Viro
authored andcommitted
task_work: add a scheduling point in task_work_run()
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 <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 5585263 commit 88ec278

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/task_work.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ void task_work_run(void)
7575
p = q->next;
7676
q->func(q);
7777
q = p;
78+
cond_resched();
7879
}
7980
}
8081
}

0 commit comments

Comments
 (0)