linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] add cond_resched() to shrink_dcache_for_umount_subtree()
@ 2013-11-12  6:20 NeilBrown
  0 siblings, 0 replies; only message in thread
From: NeilBrown @ 2013-11-12  6:20 UTC (permalink / raw)
  To: Al Viro; +Cc: lkml

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]


Much like the other shrink_dcache_*() functions,
shrink_dcache_for_umount_subtree() could run for a long time if the dcache
has many entries, so an occasional "cond_resched" is needed to avoid stalls
and soft-lockup warnings.

Unlike the other shrinkers, there is no cond_resched call here.  So add one.

Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/fs/dcache.c b/fs/dcache.c
index ae6ebb88ceff..1811fa19b419 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1154,6 +1154,7 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
 
 		dentry = list_entry(dentry->d_subdirs.next,
 				    struct dentry, d_u.d_child);
+		cond_resched()
 	}
 }
 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-12  6:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-12  6:20 [PATCH] add cond_resched() to shrink_dcache_for_umount_subtree() NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).