From patchwork Mon Sep 25 06:14:54 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: 9969271 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 1A91D6038E for ; Mon, 25 Sep 2017 06:15:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 209A328BB1 for ; Mon, 25 Sep 2017 06:15:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1584228BDF; Mon, 25 Sep 2017 06:15:17 +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=ham 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 C48E228BE0 for ; Mon, 25 Sep 2017 06:15:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932517AbdIYGPQ (ORCPT ); Mon, 25 Sep 2017 02:15:16 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:43153 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932309AbdIYGPN (ORCPT ); Mon, 25 Sep 2017 02:15:13 -0400 X-IronPort-AV: E=Sophos;i="5.42,435,1500912000"; d="scan'208";a="53984181" Received: from sjappemgw11.hgst.com (HELO sjappemgw12.hgst.com) ([199.255.44.62]) by ob1.hgst.iphmx.com with ESMTP; 25 Sep 2017 14:15:13 +0800 Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by sjappemgw12.hgst.com with ESMTP; 24 Sep 2017 23:15:12 -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 V5 14/14] block: do not set mq default scheduler Date: Mon, 25 Sep 2017 15:14:54 +0900 Message-Id: <20170925061454.5533-15-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170925061454.5533-1-damien.lemoal@wdc.com> References: <20170925061454.5533-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. " \