mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
blk-mq: fix iteration of busy bitmap
Commit889fa31f00was a bit too eager in reducing the loop count, so we ended up missing queues in some configurations. Ensure that our division rounds up, so that's not the case. Reported-by: Guenter Roeck <[email protected]> Fixes:889fa31f00("blk-mq: reduce unnecessary software queue looping") Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
54e514b91b
commit
569fd0ce96
2 changed files with 4 additions and 4 deletions
|
|
@ -41,7 +41,7 @@ static bool blk_mq_hctx_has_pending(struct blk_mq_hw_ctx *hctx)
|
|||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < hctx->ctx_map.map_size; i++)
|
||||
for (i = 0; i < hctx->ctx_map.size; i++)
|
||||
if (hctx->ctx_map.map[i].word)
|
||||
return true;
|
||||
|
||||
|
|
@ -730,7 +730,7 @@ static void flush_busy_ctxs(struct blk_mq_hw_ctx *hctx, struct list_head *list)
|
|||
struct blk_mq_ctx *ctx;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < hctx->ctx_map.map_size; i++) {
|
||||
for (i = 0; i < hctx->ctx_map.size; i++) {
|
||||
struct blk_align_bitmap *bm = &hctx->ctx_map.map[i];
|
||||
unsigned int off, bit;
|
||||
|
||||
|
|
@ -1818,7 +1818,7 @@ static void blk_mq_map_swqueue(struct request_queue *q)
|
|||
* This is more accurate and more efficient than looping
|
||||
* over all possibly mapped software queues.
|
||||
*/
|
||||
map->map_size = hctx->nr_ctx / map->bits_per_word;
|
||||
map->size = DIV_ROUND_UP(hctx->nr_ctx, map->bits_per_word);
|
||||
|
||||
/*
|
||||
* Initialize batch roundrobin counts
|
||||
|
|
|
|||
Loading…
Reference in a new issue