Skip to content

Commit 77d2b8d

Browse files
edumazetgregkh
authored andcommitted
proc: add a schedule point in proc_pid_readdir()
[ Upstream commit 3ba4bceef23206349d4130ddf140819b365de7c8 ] We have seen proc_pid_readdir() invocations holding cpu for more than 50 ms. Add a cond_resched() to be gentle with other tasks. [akpm@linux-foundation.org: coding style fix] Link: http://lkml.kernel.org/r/1484238380.15816.42.camel@edumazet-glaptop3.roam.corp.google.com Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2027766 commit 77d2b8d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/proc/base.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3058,6 +3058,8 @@ int proc_pid_readdir(struct file *file, struct dir_context *ctx)
30583058
iter.tgid += 1, iter = next_tgid(ns, iter)) {
30593059
char name[PROC_NUMBUF];
30603060
int len;
3061+
3062+
cond_resched();
30613063
if (!has_pid_permissions(ns, iter.task, 2))
30623064
continue;
30633065

0 commit comments

Comments
 (0)