aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-07-15 12:27:47 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-07-15 12:27:47 -0400
commit76828c882630ced08b5ddce22cc0095b05de9bc5 (patch)
tree1c053fd00116bfd578ccf6ec8b7b38e236ed14c9 /fs/ext4
parente15f742ce816076497549b955fbec3254820db85 (diff)
ext4: yield during large unlinks
During large unlink operations on files with extents, we can use a lot of CPU time. This adds a cond_resched() call when starting to examine the next level of a multi-level extent tree. Multi-level extent trees are rare in the first place, and this should rarely be executed. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/extents.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 593091537e76..cfdc51e30257 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2835,6 +2835,9 @@ again:
2835 err = -EIO; 2835 err = -EIO;
2836 break; 2836 break;
2837 } 2837 }
2838 /* Yield here to deal with large extent trees.
2839 * Should be a no-op if we did IO above. */
2840 cond_resched();
2838 if (WARN_ON(i + 1 > depth)) { 2841 if (WARN_ON(i + 1 > depth)) {
2839 err = -EIO; 2842 err = -EIO;
2840 break; 2843 break;