Re: [QUESTION] blk_mq_freeze_queue in elevator_init_mq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2021/11/17 18:19, Ming Lei wrote:
On Wed, Nov 17, 2021 at 05:00:22PM +0800, yangerkun wrote:


On 2021/11/17 16:06, Ming Lei wrote:
On Wed, Nov 17, 2021 at 11:37:13AM +0800, yangerkun wrote:
Nowdays we meet the boot regression while enable lots of mtdblock

What is your boot regression? Any dmesg log?

The result is that when boot with 5.10 kernel compare with 4.4, 5.10
will consume about 1.6s more...

OK, I understand the issue now, and please try the attached patch
which depends on the following one:

Hi, this patch can help solve the problem!


https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?h=block-5.16&id=2a19b28f7929866e1cec92a3619f4de9f2d20005


diff --git a/block/elevator.c b/block/elevator.c
index 1f39f6e8ebb9..19a78d5516ba 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -694,12 +694,18 @@ void elevator_init_mq(struct request_queue *q)
  	if (!e)
  		return;
+ /*
+	 * We are called before adding disk, when there isn't any FS I/O,
+	 * so freezing queue plus canceling dispatch work is enough to
+	 * drain any dispatch activities originated from passthrough
+	 * requests, then no need to quiesce queue which may add long boot
+	 * latency, especially when lots of disks are involved.
+	 */
  	blk_mq_freeze_queue(q);
-	blk_mq_quiesce_queue(q);
+	blk_mq_cancel_work_sync(q);
err = blk_mq_init_sched(q, e); - blk_mq_unquiesce_queue(q);
  	blk_mq_unfreeze_queue(q);
if (err) {



thanks,
Ming

.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux