From patchwork Sun Sep 24 07:02:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9967793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E67E26020C for ; Sun, 24 Sep 2017 07:03:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA47B21C9A for ; Sun, 24 Sep 2017 07:03:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF20F27F81; Sun, 24 Sep 2017 07:03:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93D5E21C9A for ; Sun, 24 Sep 2017 07:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751787AbdIXHDK (ORCPT ); Sun, 24 Sep 2017 03:03:10 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:35286 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751916AbdIXHDJ (ORCPT ); Sun, 24 Sep 2017 03:03:09 -0400 X-IronPort-AV: E=Sophos;i="5.42,431,1500912000"; d="scan'208";a="156248379" Received: from sjappemgw12.hgst.com (HELO sjappemgw11.hgst.com) ([199.255.44.66]) by ob1.hgst.iphmx.com with ESMTP; 24 Sep 2017 15:03:09 +0800 Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by sjappemgw11.hgst.com with ESMTP; 24 Sep 2017 00:03:08 -0700 From: Damien Le Moal To: linux-scsi@vger.kernel.org, "Martin K . Petersen" , linux-block@vger.kernel.org, Jens Axboe Cc: Christoph Hellwig , Bart Van Assche Subject: [PATCH V4 15/16] block: do not set mq defaulte scheduler Date: Sun, 24 Sep 2017 16:02:46 +0900 Message-Id: <20170924070247.25560-16-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170924070247.25560-1-damien.lemoal@wdc.com> References: <20170924070247.25560-1-damien.lemoal@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For blk-mq disks with a single hardware queue, setting by default the disk scheduler to mq-deadline early during the queue initialization prevents properly setting zone write locking for zoned block device as the fact that the disk is zoned is not yet known. Fix this by simply not setting the default scheduler to mq-deadline for single hardware queue disks. udev can be used to easily do the same later in the system initialization sequence, when the device characteristics are known. Signed-off-by: Damien Le Moal --- block/elevator.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 153926a90901..8b65a757f726 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -222,19 +222,14 @@ int elevator_init(struct request_queue *q, char *name) if (!e) { /* - * For blk-mq devices, we default to using mq-deadline, - * if available, for single queue devices. If deadline - * isn't available OR we have multiple queues, default - * to "none". + * For blk-mq devices, default to "none". udev can later set + * an appropriate default scheduler based on the disk + * characteristics which we do not yet have here. */ - if (q->mq_ops) { - if (q->nr_hw_queues == 1) - e = elevator_get("mq-deadline", false); - if (!e) - return 0; - } else - e = elevator_get(CONFIG_DEFAULT_IOSCHED, false); + if (q->mq_ops) + return 0; + e = elevator_get(CONFIG_DEFAULT_IOSCHED, false); if (!e) { printk(KERN_ERR "Default I/O scheduler not found. " \