diff options
author | Jens Axboe <axboe@fb.com> | 2014-11-24 15:02:42 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-16 06:59:31 -0800 |
commit | bdc69c2acca3f51e7f572c1e2a823894b16572e9 (patch) | |
tree | 362efa9d0b60cce24f9d22b51e03db0e37e9fc05 /block | |
parent | 4ce9fbccfb9ee64bec6ac125150e2beac5f0c42f (diff) |
blk-mq: use 'nr_cpu_ids' as highest CPU ID count for hwq <-> cpu map
commit a33c1ba2913802b6fb23e974bb2f6a4e73c8b7ce 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: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq-cpumap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c index f8721278601c..78d38352bf8d 100644 --- a/block/blk-mq-cpumap.c +++ b/block/blk-mq-cpumap.c @@ -95,7 +95,7 @@ unsigned int *blk_mq_make_queue_map(struct blk_mq_reg *reg) unsigned int *map; /* 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); if (!map) return NULL; |