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:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user