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: 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; } |