]>
Commit | Line | Data |
---|---|---|
2de4f881 GKH |
1 | From a33c1ba2913802b6fb23e974bb2f6a4e73c8b7ce Mon Sep 17 00:00:00 2001 |
2 | From: Jens Axboe <axboe@fb.com> | |
3 | Date: Mon, 24 Nov 2014 15:02:42 -0700 | |
4 | Subject: blk-mq: use 'nr_cpu_ids' as highest CPU ID count for hwq <-> cpu map | |
5 | ||
6 | From: Jens Axboe <axboe@fb.com> | |
7 | ||
8 | commit a33c1ba2913802b6fb23e974bb2f6a4e73c8b7ce upstream. | |
9 | ||
10 | We currently use num_possible_cpus(), but that breaks on sparc64 where | |
11 | the CPU ID space is discontig. Use nr_cpu_ids as the highest CPU ID | |
12 | instead, so we don't end up reading from invalid memory. | |
13 | ||
14 | Signed-off-by: Jens Axboe <axboe@fb.com> | |
15 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
16 | ||
17 | --- | |
18 | block/blk-mq-cpumap.c | 2 +- | |
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
20 | ||
21 | --- a/block/blk-mq-cpumap.c | |
22 | +++ b/block/blk-mq-cpumap.c | |
23 | @@ -90,7 +90,7 @@ unsigned int *blk_mq_make_queue_map(stru | |
24 | unsigned int *map; | |
25 | ||
26 | /* If cpus are offline, map them to first hctx */ | |
27 | - map = kzalloc_node(sizeof(*map) * num_possible_cpus(), GFP_KERNEL, | |
28 | + map = kzalloc_node(sizeof(*map) * nr_cpu_ids, GFP_KERNEL, | |
29 | set->numa_node); | |
30 | if (!map) | |
31 | return NULL; |