diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-11-18 12:13:12 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-11-18 12:13:12 -0500 |
commit | 105d931d482b7d1b1b2dd4b0ea30365db8630b9f (patch) | |
tree | e3c8ba5bc5cb5fcbf6ac33b08c701e1e8cdabf10 /fs/btrfs | |
parent | 73e9f5beb16f568f797bba87f082556fac18dede (diff) |
Btrfs: switch back to wait_on_page_writeback to wait on metadata writes
The extent based waiting was using more CPU, and other fixes have helped
with the unplug storm problems.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/transaction.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index e9c8ebeedd7e..c2c3b4281962 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -332,7 +332,6 @@ int btrfs_write_and_wait_marked_extents(struct btrfs_root *root, | |||
332 | int werr = 0; | 332 | int werr = 0; |
333 | struct page *page; | 333 | struct page *page; |
334 | struct inode *btree_inode = root->fs_info->btree_inode; | 334 | struct inode *btree_inode = root->fs_info->btree_inode; |
335 | struct extent_io_tree *io_tree = &BTRFS_I(btree_inode)->io_tree; | ||
336 | u64 start = 0; | 335 | u64 start = 0; |
337 | u64 end; | 336 | u64 end; |
338 | unsigned long index; | 337 | unsigned long index; |
@@ -373,11 +372,6 @@ int btrfs_write_and_wait_marked_extents(struct btrfs_root *root, | |||
373 | page_cache_release(page); | 372 | page_cache_release(page); |
374 | } | 373 | } |
375 | } | 374 | } |
376 | /* | ||
377 | * we unplug once and then use the wait_on_extent_bit for | ||
378 | * everything else | ||
379 | */ | ||
380 | blk_run_address_space(btree_inode->i_mapping); | ||
381 | while(1) { | 375 | while(1) { |
382 | ret = find_first_extent_bit(dirty_pages, 0, &start, &end, | 376 | ret = find_first_extent_bit(dirty_pages, 0, &start, &end, |
383 | EXTENT_DIRTY); | 377 | EXTENT_DIRTY); |
@@ -398,28 +392,7 @@ int btrfs_write_and_wait_marked_extents(struct btrfs_root *root, | |||
398 | if (err) | 392 | if (err) |
399 | werr = err; | 393 | werr = err; |
400 | } | 394 | } |
401 | if (PageWriteback(page)) { | 395 | wait_on_page_writeback(page); |
402 | /* | ||
403 | * we don't wait on the page writeback bit | ||
404 | * because that triggers a lot of unplugs. | ||
405 | * The extent bits are much nicer to | ||
406 | * the disks, but come with a slightly | ||
407 | * higher latency because we aren't forcing | ||
408 | * unplugs. | ||
409 | */ | ||
410 | wait_on_extent_writeback(io_tree, | ||
411 | page_offset(page), | ||
412 | page_offset(page) + | ||
413 | PAGE_CACHE_SIZE - 1); | ||
414 | } | ||
415 | if (PageWriteback(page)) { | ||
416 | /* | ||
417 | * the state bits get cleared before the | ||
418 | * page bits, lets add some extra | ||
419 | * paranoia here | ||
420 | */ | ||
421 | wait_on_page_writeback(page); | ||
422 | } | ||
423 | page_cache_release(page); | 396 | page_cache_release(page); |
424 | cond_resched(); | 397 | cond_resched(); |
425 | } | 398 | } |