From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932647AbcFNUBe (ORCPT ); Tue, 14 Jun 2016 16:01:34 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:38122 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932276AbcFNT7k (ORCPT ); Tue, 14 Jun 2016 15:59:40 -0400 From: Christoph Hellwig To: tglx@linutronix.de, axboe@fb.com Cc: linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/13] blk-mq: don't redistribute hardware queues on a CPU hotplug event Date: Tue, 14 Jun 2016 21:59:02 +0200 Message-Id: <1465934346-20648-10-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465934346-20648-1-git-send-email-hch@lst.de> References: <1465934346-20648-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently blk-mq will totally remap hardware context when a CPU hotplug even happened, which causes major havoc for drivers, as they are never told about this remapping. E.g. any carefully sorted out CPU affinity will just be completely messed up. The rebuild also doesn't really help for the common case of cpu hotplug, which is soft onlining / offlining of cpus - in this case we should just leave the queue and irq mapping as is. If it actually worked it would have helped in the case of physical cpu hotplug, although for that we'd need a way to actually notify the driver. Note that drivers may already be able to accommodate such a topology change on their own, e.g. using the reset_controller sysfs file in NVMe will cause the driver to get things right for this case. With the rebuild removed we will simplify retain the queue mapping for a soft offlined CPU that will work when it comes back online, and will map any newly onlined CPU to queue NULL until the driver initiates a rebuild of the queue map. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index bc7166d..f972d32 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2114,8 +2114,6 @@ static void blk_mq_queue_reinit(struct request_queue *q, blk_mq_sysfs_unregister(q); - blk_mq_update_queue_map(q->mq_map, q->nr_hw_queues, online_mask); - /* * redo blk_mq_init_cpu_queues and blk_mq_init_hw_queues. FIXME: maybe * we should change hctx numa_node according to new topology (this -- 2.1.4