Skip to content

Commit

Permalink
blk-mq: use 'nr_cpu_ids' as highest CPU ID count for hwq <-> cpu map
Browse files Browse the repository at this point in the history
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.

Cc: [email protected] # 3.13+
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Nov 24, 2014
1 parent 394ffa5 commit a33c1ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-mq-cpumap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a33c1ba

Please sign in to comment.