Commit 1d9e2ae9 authored by Chris Mason's avatar Chris Mason

Btrfs: Clear the device->running_pending flag before bailing on congestion

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: default avatarChris Mason <chris.mason@oracle.com>
parent e293e97e
...@@ -220,6 +220,7 @@ loop: ...@@ -220,6 +220,7 @@ loop:
tail->bi_next = old_head; tail->bi_next = old_head;
else else
device->pending_bio_tail = tail; device->pending_bio_tail = tail;
device->running_pending = 0;
spin_unlock(&device->io_lock); spin_unlock(&device->io_lock);
btrfs_requeue_work(&device->work); btrfs_requeue_work(&device->work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment