]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: allow block group cache writeout outside critical section in commit
authorChris Mason <clm@fb.com>
Mon, 6 Apr 2015 19:46:08 +0000 (12:46 -0700)
committerChris Mason <clm@fb.com>
Fri, 10 Apr 2015 21:07:22 +0000 (14:07 -0700)
commit6a258f627cc1e6dc0ef01aad3d55aee054d0860c
treed2c9e87e9cef8884a440bc9b6a5bf6574eff9fc7
parent5a24ef62fdbd470b67598d592ba6cb06a7a8887d
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>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/free-space-cache.c
fs/btrfs/free-space-cache.h
fs/btrfs/inode-map.c
fs/btrfs/relocation.c
fs/btrfs/transaction.c
fs/btrfs/transaction.h