proc: add a schedule point in proc_pid_readdir()
commit9618fba264999372c641b5cb3db777c6a216caa5
authorEric Dumazet <edumazet@google.com>
Tue, 24 Jan 2017 23:18:07 +0000 (24 15:18 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Jun 2017 04:41:56 +0000 (17 06:41 +0200)
tree41417a950a5385fcefefc35200755fd3b92a7109
parente23b1c05a50ffc7cabe12b9bc4fdfa55e32d9614
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>
fs/proc/base.c