From: Theodore Ts'o Date: Mon, 15 Jul 2013 16:27:47 +0000 (-0400) Subject: ext4: yield during large unlinks X-Git-Tag: next-20130717~62^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3223fd0fe49c4cdcf9302874a2ace4dc13dae22e;p=karo-tx-linux.git 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" --- 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: err = -EIO; break; } + /* Yield here to deal with large extent trees. + * Should be a no-op if we did IO above. */ + cond_resched(); if (WARN_ON(i + 1 > depth)) { err = -EIO; break;