summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-07-30 10:04:48 -0400
committerChris Mason <chris.mason@oracle.com>2009-07-30 10:14:46 -0400
commitf36f3042eae238bdaefe7c79310afe573bfc3622 (patch)
tree83ea0e271dedeef36423509be7f4189b838d14b5 /fs/btrfs/extent-tree.c
parent276e680d192a67d222fcea51af37b056feffb665 (diff)
downloadlinux-f36f3042eae238bdaefe7c79310afe573bfc3622.tar.gz
linux-f36f3042eae238bdaefe7c79310afe573bfc3622.tar.bz2
linux-f36f3042eae238bdaefe7c79310afe573bfc3622.zip
Btrfs: be more polite in the async caching threads
The semaphore used by the async caching threads can prevent a transaction commit, which can make the FS appear to stall. This releases the semaphore more often when a transaction commit is in progress. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 2fe21fa74913..dc84daee6bc4 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -302,10 +302,11 @@ again:
else if (ret)
break;
- if (need_resched()) {
+ if (need_resched() ||
+ btrfs_transaction_in_commit(fs_info)) {
btrfs_release_path(fs_info->extent_root, path);
up_read(&fs_info->extent_commit_sem);
- cond_resched();
+ schedule_timeout(1);
goto again;
}