Skip to content

Commit

Permalink
Btrfs: run the backing dev more often in the submit_bio helper
Browse files Browse the repository at this point in the history
The submit_bio helper thread can decide to loop back around to
service more bios.  This commit forces it to unplug first, which helps
reduce the latency seen by submitters.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Mar 15, 2010
1 parent 4849f01 commit 5168408
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,6 @@ static noinline int run_scheduled_bios(struct btrfs_device *device)
num_sync_run = 0;
blk_run_backing_dev(bdi, NULL);
}

cond_resched();
if (again)
goto loop;

spin_lock(&device->io_lock);
if (device->pending_bios.head || device->pending_sync_bios.head)
goto loop_lock;
spin_unlock(&device->io_lock);

/*
* IO has already been through a long path to get here. Checksumming,
* async helper threads, perhaps compression. We've done a pretty
Expand All @@ -346,6 +336,16 @@ static noinline int run_scheduled_bios(struct btrfs_device *device)
* cared about found its way down here.
*/
blk_run_backing_dev(bdi, NULL);

cond_resched();
if (again)
goto loop;

spin_lock(&device->io_lock);
if (device->pending_bios.head || device->pending_sync_bios.head)
goto loop_lock;
spin_unlock(&device->io_lock);

done:
return 0;
}
Expand Down

0 comments on commit 5168408

Please sign in to comment.