diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-11-07 18:22:45 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-11-07 18:22:45 -0500 |
commit | 5f2cc086ccab27ac5252b3883ac004347860b4c7 (patch) | |
tree | 5d9d1a5ebce044fabf6491e454af60289895bba5 /fs/btrfs/volumes.c | |
parent | 42e70e7a2f9d96fd843723fa46d5121cb3e551d0 (diff) | |
download | linux-5f2cc086ccab27ac5252b3883ac004347860b4c7.tar.gz linux-5f2cc086ccab27ac5252b3883ac004347860b4c7.tar.bz2 linux-5f2cc086ccab27ac5252b3883ac004347860b4c7.zip |
Btrfs: Avoid unplug storms during commit
While doing a commit, btrfs makes sure all the metadata blocks
were properly written to disk, calling wait_on_page_writeback for
each page. This writeback happens after allowing another transaction
to start, so it competes for the disk with other processes in the FS.
If the page writeback bit is still set, each wait_on_page_writeback might
trigger an unplug, even though the page might be waiting for checksumming
to finish or might be waiting for the async work queue to submit the
bio.
This trades wait_on_page_writeback for waiting on the extent writeback
bits. It won't trigger any unplugs and substantially improves performance
in a number of workloads.
This also changes the async bio submission to avoid requeueing if there
is only one device. The requeue just wastes CPU time because there are
no other devices to service.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index cbb9bb31431d..80a27284dbf1 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -200,7 +200,8 @@ loop: * is now congested. Back off and let other work structs * run instead */ - if (pending && bdi_write_congested(bdi)) { + if (pending && bdi_write_congested(bdi) && + fs_info->fs_devices->open_devices > 1) { struct bio *old_head; spin_lock(&device->io_lock); |