Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Browse files Browse the repository at this point in the history
Pull block core fix from Jens Axboe:
 "A commit in the previous pull request introduce a regression.  So far
  only observed on qemu-sparc64, but it's a general bug.  Please pull
  this single fix to rectify that, thanks"

[ And it turns out that it's been seen outside of that qemu-sparc64
  case, and is easy to trigger with small number of CPUs and blk-mq
  enabled by default - Linus ]

* 'for-linus' of git://git.kernel.dk/linux-block:
  blk-mq: fix iteration of busy bitmap
  • Loading branch information
Linus Torvalds committed Apr 17, 2015
2 parents 0f5abd4 + 569fd0c commit e076b7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/linux/blk-mq.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct blk_mq_cpu_notifier {
};

struct blk_mq_ctxmap {
unsigned int map_size;
unsigned int size;
unsigned int bits_per_word;
struct blk_align_bitmap *map;
};
Expand Down

0 comments on commit e076b7c

Please sign in to comment.