Commit
889fa31f00b2 was 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 <linux@roeck-us.net>
Fixes:
889fa31f00b2 ("blk-mq: reduce unnecessary software queue looping")
Signed-off-by: Jens Axboe <axboe@fb.com>
- 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;
if (hctx->ctx_map.map[i].word)
return true;
struct blk_mq_ctx *ctx;
int i;
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;
struct blk_align_bitmap *bm = &hctx->ctx_map.map[i];
unsigned int off, bit;
* This is more accurate and more efficient than looping
* over all possibly mapped software queues.
*/
* 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
/*
* Initialize batch roundrobin counts
};
struct blk_mq_ctxmap {
};
struct blk_mq_ctxmap {
unsigned int bits_per_word;
struct blk_align_bitmap *map;
};
unsigned int bits_per_word;
struct blk_align_bitmap *map;
};