From patchwork Mon Oct 2 07:15:35 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: 9980325 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 30DE360365 for ; Mon, 2 Oct 2017 07:15:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 243B22022B for ; Mon, 2 Oct 2017 07:15:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 193F227FBC; Mon, 2 Oct 2017 07:15:59 +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 D13622022B for ; Mon, 2 Oct 2017 07:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751268AbdJBHPx (ORCPT ); Mon, 2 Oct 2017 03:15:53 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:22502 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbdJBHPx (ORCPT ); Mon, 2 Oct 2017 03:15:53 -0400 X-IronPort-AV: E=Sophos;i="5.42,468,1500912000"; d="scan'208";a="151954164" Received: from sjappemgw11.hgst.com (HELO sjappemgw12.hgst.com) ([199.255.44.62]) by ob1.hgst.iphmx.com with ESMTP; 02 Oct 2017 15:24:10 +0800 Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by sjappemgw12.hgst.com with ESMTP; 02 Oct 2017 00:15:52 -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 V6 14/14] block: do not set mq default scheduler Date: Mon, 2 Oct 2017 16:15:35 +0900 Message-Id: <20171002071535.8007-15-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171002071535.8007-1-damien.lemoal@wdc.com> References: <20171002071535.8007-1-damien.lemoal@wdc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 host managed zoned block device as the disk type is not yet known. Fix this by simply not setting the default scheduler to mq-deadline for single hardware queue disks. A udev rule 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. " \