]> git.baikalelectronics.ru Git - kernel.git/commit
proc: add a reschedule point in proc_readfd_common()
authorEric Dumazet <edumazet@google.com>
Thu, 3 Dec 2015 19:12:07 +0000 (11:12 -0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 9 Jan 2016 07:56:10 +0000 (02:56 -0500)
commit22b8fdeedf8bc222aab55b53e00a9d8521a9b044
treed538f2cde041d28d7ca3320d0e88d592cb76abad
parent1ea359fb3495efbeeb465eb46162ba8bd54dd6af
proc: add a reschedule point in proc_readfd_common()

User can pass an arbitrary large buffer to getdents().

It is typically a 32KB buffer used by libc scandir() implementation.

When scanning /proc/{pid}/fd, we can hold cpu way too long,
so add a cond_resched() to be kind with other tasks.

We've seen latencies of more than 50ms on real workloads.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/proc/fd.c