diff options
author | Omar Sandoval <osandov@fb.com> | 2017-12-05 22:57:43 -0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-12-06 12:33:07 -0700 |
commit | fcf38cdf332a81b20a59e3ebaea81f6b316bbe0c (patch) | |
tree | 0e6b81c6bb908381eb851ef1a334a56943e9be6d /block/bounce.c | |
parent | ae64f9bd1d3621b5e60d7363bc20afb46aede215 (diff) |
kyber: fix another domain token wait queue hang
Commit 8cf466602028 ("kyber: fix hang on domain token wait queue") fixed
a hang caused by leaving wait entries on the domain token wait queue
after the __sbitmap_queue_get() retry succeeded, making that wait entry
a "dud" which won't in turn wake more entries up. However, we can also
get a dud entry if kyber_get_domain_token() fails once but is then
called again and succeeds. This can happen if the hardware queue is
rerun for some other reason, or, more likely, kyber_dispatch_request()
tries the same domain twice.
The fix is to remove our entry from the wait queue whenever we
successfully get a token. The only complication is that we might be on
one of many wait queues in the struct sbitmap_queue, but that's easily
fixed by remembering which wait queue we were put on.
While we're here, only initialize the wait queue entry once instead of
on every wait, and use spin_lock_irq() instead of spin_lock_irqsave(),
since this is always called from process context with irqs enabled.
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bounce.c')
0 files changed, 0 insertions, 0 deletions