proc: add a schedule point in proc_pid_readdir()
PATCH 9/26 proc: add a schedule point in proc_pid_readdir()
From: Eric Dumazet <[email protected]>
Subject: proc: add a schedule point in proc_pid_readdir()
We have seen proc_pid_readdir() invocations holding cpu for more than 50 ms. Add a cond_resched() to be gentle with other tasks.
[[email protected]: coding style fix]
Signed-off-by Eric Dumazet <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
fs/proc/base.c | 2 ++ 1 file changed, 2 insertions(+)
fs/proc/base.c renamed from fs/proc/base.c~proc-add-a-schedule-point-in-proc_pid_readdir +2 -0
@@ -3179,6 +3179,8 @@ int proc_pid_readdir(struct file *file, iter.tgid += 1, iter = next_tgid(ns, iter)) {char name[PROC_NUMBUF ];int len; + +cond_resched ();if (!has_pid_permissions (ns, iter.task,2 ))continue ;
_