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>
This commit is contained in:
Chris Mason
2009-07-30 10:04:48 -04:00
parent 276e680d19
commit f36f3042ea
3 changed files with 14 additions and 2 deletions

View File

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