diff options
author | Chris Mason <clm@fb.com> | 2015-04-06 19:46:08 (GMT) |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-04-10 21:07:22 (GMT) |
commit | 1bbc621ef28462456131c035eaeb5567a1a2a2fe (patch) | |
tree | d2c9e87e9cef8884a440bc9b6a5bf6574eff9fc7 /fs/btrfs/disk-io.c | |
parent | 2b108268006e06d57ec9810f4ccf5d99d7e5b598 (diff) | |
download | linux-1bbc621ef28462456131c035eaeb5567a1a2a2fe.tar.xz |
Btrfs: allow block group cache writeout outside critical section in commit
We loop through all of the dirty block groups during commit and write
the free space cache. In order to make sure the cache is currect, we do
this while no other writers are allowed in the commit.
If a large number of block groups are dirty, this can introduce long
stalls during the final stages of the commit, which can block new procs
trying to change the filesystem.
This commit changes the block group cache writeout to take appropriate
locks and allow it to run earlier in the commit. We'll still have to
redo some of the block groups, but it means we can get most of the work
out of the way without blocking the entire FS.
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 568cc4e..b5e3d5f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2572,6 +2572,7 @@ int open_ctree(struct super_block *sb, mutex_init(&fs_info->transaction_kthread_mutex); mutex_init(&fs_info->cleaner_mutex); mutex_init(&fs_info->volume_mutex); + mutex_init(&fs_info->ro_block_group_mutex); init_rwsem(&fs_info->commit_root_sem); init_rwsem(&fs_info->cleanup_work_sem); init_rwsem(&fs_info->subvol_sem); |