Skip to contentSkip to conversation

add cond_resched() to shrink_dcache_for_umount_subtree()

PATCH New NeilBrown 1 participant 1 message Nov 12, 2013 VFS

lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 add cond_resched() to shrink_dcache_for_umount_subtree()

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.

fs/dcache.c +1 -0
index ae6ebb88ceff..1811fa19b419 100644
@@ -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()
 	}
 }