diff options
author | Chris Mason <chris.mason@oracle.com> | 2009-07-30 10:04:48 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-07-30 10:14:46 -0400 |
commit | f36f3042eae238bdaefe7c79310afe573bfc3622 (patch) | |
tree | 83ea0e271dedeef36423509be7f4189b838d14b5 /fs/btrfs/extent-tree.c | |
parent | 276e680d192a67d222fcea51af37b056feffb665 (diff) |
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.c | 5 |
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: | |||
302 | else if (ret) | 302 | else if (ret) |
303 | break; | 303 | break; |
304 | 304 | ||
305 | if (need_resched()) { | 305 | if (need_resched() || |
306 | btrfs_transaction_in_commit(fs_info)) { | ||
306 | btrfs_release_path(fs_info->extent_root, path); | 307 | btrfs_release_path(fs_info->extent_root, path); |
307 | up_read(&fs_info->extent_commit_sem); | 308 | up_read(&fs_info->extent_commit_sem); |
308 | cond_resched(); | 309 | schedule_timeout(1); |
309 | goto again; | 310 | goto again; |
310 | } | 311 | } |
311 | 312 | ||