Commit bdc69c2a authored by Jens Axboe's avatar Jens Axboe Committed by Greg Kroah-Hartman

blk-mq: use 'nr_cpu_ids' as highest CPU ID count for hwq <-> cpu map

commit a33c1ba2 upstream.

We currently use num_possible_cpus(), but that breaks on sparc64 where
the CPU ID space is discontig. Use nr_cpu_ids as the highest CPU ID
instead, so we don't end up reading from invalid memory.
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4ce9fbcc
...@@ -95,7 +95,7 @@ unsigned int *blk_mq_make_queue_map(struct blk_mq_reg *reg) ...@@ -95,7 +95,7 @@ unsigned int *blk_mq_make_queue_map(struct blk_mq_reg *reg)
unsigned int *map; unsigned int *map;
/* If cpus are offline, map them to first hctx */ /* If cpus are offline, map them to first hctx */
map = kzalloc_node(sizeof(*map) * num_possible_cpus(), GFP_KERNEL, map = kzalloc_node(sizeof(*map) * nr_cpu_ids, GFP_KERNEL,
reg->numa_node); reg->numa_node);
if (!map) if (!map)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment