blk-mq: Create hctx for each present CPU 84/290884/2 accepted/tizen/unified/20230406.165743
authorChristoph Hellwig <hch@lst.de>
Mon, 26 Jun 2017 10:20:57 +0000 (12:20 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 5 Apr 2023 01:20:19 +0000 (10:20 +0900)
commitc0317120b60d850340490b69e63f47304f76eda2
tree9964187e48922b19132299c78eae05e4db4531a6
parent4a4595d3b13017cbd600f18b1c0ff2e2cd7082ec
blk-mq: Create hctx for each present CPU

Currently we only create hctx for online CPUs, which can lead to a lot
of churn due to frequent soft offline / online operations.  Instead
allocate one for each present CPU to avoid this and dramatically simplify
the code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Cc: Keith Busch <keith.busch@intel.com>
Cc: linux-block@vger.kernel.org
Cc: linux-nvme@lists.infradead.org
Link: http://lkml.kernel.org/r/20170626102058.10200-3-hch@lst.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Oleksandr Natalenko <oleksandr@natalenko.name>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[sw0312.kim: backport mainline commit 4b855ad37194 to fix possible deadlock in blk-mq for cpu hotplug]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I019f976ab755a38f4c783e94c73a4ff60114a648
block/blk-mq.c
block/blk-mq.h
include/linux/cpuhotplug.h