diff options
author | Jens Axboe <axboe@fb.com> | 2014-11-24 15:02:42 -0700 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2015-01-12 15:43:57 +0000 |
commit | 1e4d0665e0b96e456b67fcfc8a3c6d0120cbbcf6 (patch) | |
tree | 627f95fdacf5b85ead31205b1f8ccb3bce341d2e /block | |
parent | 7ab6d2a021613176d94ba5f41e94e6974341a663 (diff) | |
download | linux-stable-1e4d0665e0b96e456b67fcfc8a3c6d0120cbbcf6.tar.gz linux-stable-1e4d0665e0b96e456b67fcfc8a3c6d0120cbbcf6.tar.bz2 linux-stable-1e4d0665e0b96e456b67fcfc8a3c6d0120cbbcf6.zip |
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: Luis Henriques <luis.henriques@canonical.com>
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 1065d7c65fa1..72e5ed691e37 100644 --- a/block/blk-mq-cpumap.c +++ b/block/blk-mq-cpumap.c @@ -90,7 +90,7 @@ unsigned int *blk_mq_make_queue_map(struct blk_mq_tag_set *set) 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, set->numa_node); if (!map) return NULL; |