proc: add a schedule point in proc_pid_readdir()
authorEric Dumazet <edumazet@google.com>
Tue, 24 Jan 2017 23:18:07 +0000 (15:18 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Jun 2017 04:39:38 +0000 (06:39 +0200)
commit77d2b8dc959745f37605706c64c55bd80cfae660
treee95e8a4dd0c0925ab69f58f9b12bfe3e4f180c5d
parent202776694c2ae6b76e4e1d7b7f01d604f8d16089
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