]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.18.3/blk-mq-use-nr_cpu_ids-as-highest-cpu-id-count-for-hwq-cpu-map.patch
drop drm patch
[thirdparty/kernel/stable-queue.git] / releases / 3.18.3 / blk-mq-use-nr_cpu_ids-as-highest-cpu-id-count-for-hwq-cpu-map.patch
CommitLineData
2de4f881
GKH
1From a33c1ba2913802b6fb23e974bb2f6a4e73c8b7ce Mon Sep 17 00:00:00 2001
2From: Jens Axboe <axboe@fb.com>
3Date: Mon, 24 Nov 2014 15:02:42 -0700
4Subject: blk-mq: use 'nr_cpu_ids' as highest CPU ID count for hwq <-> cpu map
5
6From: Jens Axboe <axboe@fb.com>
7
8commit a33c1ba2913802b6fb23e974bb2f6a4e73c8b7ce upstream.
9
10We currently use num_possible_cpus(), but that breaks on sparc64 where
11the CPU ID space is discontig. Use nr_cpu_ids as the highest CPU ID
12instead, so we don't end up reading from invalid memory.
13
14Signed-off-by: Jens Axboe <axboe@fb.com>
15Signed-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;