* [patch 09/26] proc: add a schedule point in proc_pid_readdir()
@ 2017-01-24 23:18 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2017-01-24 23:18 UTC (permalink / raw)
To: torvalds, mm-commits, akpm, edumazet
From: Eric Dumazet <edumazet@google.com>
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.
[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>
---
fs/proc/base.c | 2 ++
1 file changed, 2 insertions(+)
diff -puN fs/proc/base.c~proc-add-a-schedule-point-in-proc_pid_readdir fs/proc/base.c
--- a/fs/proc/base.c~proc-add-a-schedule-point-in-proc_pid_readdir
+++ a/fs/proc/base.c
@@ -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;
_
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-24 23:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24 23:18 [patch 09/26] proc: add a schedule point in proc_pid_readdir() akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.