From: Bin Zha <[email protected]>
When the kyber adjusts the sync and other write depth to the
minimum(1), there is a case that maybe cause the requests to
be stalled in the kyber_hctx_data list.
The following example I have tested:
CPU7
block_rq_insert
add_wait_queue
__sbitmap_queue_get CPU23
block_rq_issue block_rq_insert
block_rq_complete ------> waiting token free
block_rq_issue
/|\ block_rq_complete
| |
| |
| \|/
| CPU29
| block_rq_insert
| waiting token free
| block_rq_issue
|---------------------- block_rq_complete
CPU1
block_rq_insert
waiting token free
The IO request complete in CPU29 will wake up CPU7,
because it has been added to the waitqueue in
kyber_get_domain_token. But it is empty waiter, and won't
wake up the CPU1.If no other requests issue to push it,
the requests will stall in kyber_hctx_data list.
Signed-off-by: Bin Zha <[email protected]>
diff --git a/block/kyber-iosched.c b/block/kyber-iosched.c
index b9faabc..584bfd5 100644
--- a/block/kyber-iosched.c
+++ b/block/kyber-iosched.c
@@ -548,6 +548,10 @@ static int kyber_get_domain_token(struct
kyber_queue_data *kqd,
* queue.
*/
nr = __sbitmap_queue_get(domain_tokens);
+ if (nr >= 0) {
+ remove_wait_queue(&ws->wait, wait);
+ INIT_LIST_HEAD(&wait->task_list);
+ }
}
return nr;
}