[3.13.y-ckt stable] Patch "blk-mq: use 'nr_cpu_ids' as highest CPU ID count for hwq <-> cpu map" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Wed Jan 28 22:19:52 UTC 2015


This is a note to let you know that I have just added a patch titled

    blk-mq: use 'nr_cpu_ids' as highest CPU ID count for hwq <-> cpu map

to the linux-3.13.y-queue branch of the 3.13.y-ckt extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.13.y-queue

This patch is scheduled to be released in version 3.13.11-ckt15.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From db6805586aba8d1450c68b10f199947e836045ce Mon Sep 17 00:00:00 2001
From: Jens Axboe <axboe at fb.com>
Date: Mon, 24 Nov 2014 15:02:42 -0700
Subject: 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 at fb.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 block/blk-mq-cpumap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c
index f872127..78d3835 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;
--
1.9.1





More information about the kernel-team mailing list