diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2019-10-15 13:46:25 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2019-10-21 15:57:07 +0200 |
commit | c17ea009610366146ec409fd6dc277e0f2510b10 (patch) | |
tree | cedb3dac2277ac7d19af9646cb93b0cf95aa0e7e /block/elevator.c | |
parent | 5dbe190f341206a7896f7e40c1e3a36933d812f3 (diff) | |
download | linux-riscv-c17ea009610366146ec409fd6dc277e0f2510b10.tar.gz linux-riscv-c17ea009610366146ec409fd6dc277e0f2510b10.tar.bz2 linux-riscv-c17ea009610366146ec409fd6dc277e0f2510b10.zip |
virtiofs: Count pending forgets as in_flight forgets
If virtqueue is full, we put forget requests on a list and these forgets
are dispatched later using a worker. As of now we don't count these forgets
in fsvq->in_flight variable. This means when queue is being drained, we
have to have special logic to first drain these pending requests and then
wait for fsvq->in_flight to go to zero.
By counting pending forgets in fsvq->in_flight, we can get rid of special
logic and just wait for in_flight to go to zero. Worker thread will kick
and drain all the forgets anyway, leading in_flight to zero.
I also need similar logic for normal request queue in next patch where I am
about to defer request submission in the worker context if queue is full.
This simplifies the code a bit.
Also add two helper functions to inc/dec in_flight. Decrement in_flight
helper will later used to call completion when in_flight reaches zero.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'block/elevator.c')
0 files changed, 0 insertions, 0 deletions