Skip to content

Commit

Permalink
Btrfs: Clear the device->running_pending flag before bailing on conge…
Browse files Browse the repository at this point in the history
…stion

Btrfs maintains a queue of async bio submissions so the checksumming
threads don't have to wait on get_request_wait.  In order to avoid
extra wakeups, this code has a running_pending flag that is used
to tell new submissions they don't need to wake the thread.

When the threads notice congestion on a single device, they
may decide to requeue the job and move on to other devices.  This
makes sure the running_pending flag is cleared before the
job is requeued.

It should help avoid IO stalls by making sure the task is woken up
when new submissions come in.

Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
chrismason-xx committed Jan 16, 2009
1 parent e293e97 commit 1d9e2ae
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ static noinline int run_scheduled_bios(struct btrfs_device *device)
tail->bi_next = old_head;
else
device->pending_bio_tail = tail;
device->running_pending = 0;

spin_unlock(&device->io_lock);
btrfs_requeue_work(&device->work);
Expand Down

0 comments on commit 1d9e2ae

Please sign in to comment.