From patchwork Wed Sep 26 07:30:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 10615367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6567713A4 for ; Wed, 26 Sep 2018 07:30:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 505002A52E for ; Wed, 26 Sep 2018 07:30:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44AB02A463; Wed, 26 Sep 2018 07:30:41 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 CFE5B2A40F for ; Wed, 26 Sep 2018 07:30:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726690AbeIZNmM (ORCPT ); Wed, 26 Sep 2018 09:42:12 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:59673 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726704AbeIZNmM (ORCPT ); Wed, 26 Sep 2018 09:42:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1537947040; x=1569483040; h=from:to:subject:date:message-id; bh=VcysnDVyuLRkN6YgoG0WC/aJk+itLr/lf+qRzMrt0e0=; b=HO5VUVI/lYWNE8oKZ6kl2vNnE9WlozEadXSQVU/IvlCRuQJqm1nxUIO8 gxQUQnRh+J320DHzLgTUJPV/KXiQroFqhgm7w2Zql4Iqwt9D1jOvK90Yk XascSCJ3BMUgkvGt6JXFxu8qrfSDE2ooCfhGz3wOghXernLOcwuYGHiPt +AZtd3arynNjzcQGBGK3JGjPg7PH50duSutFqbKVGuJEG0BZlQyeKW3/i gGdZdehNJyxP0Y/KceCzY3ZbZz93akbnsQCFNgM/R0jRRiE8Q6dNumM+H ox0St9GTB1I0z9TrnewIdIOi5b9HkvBTlRReDAMLUGh0bQdb6EmftVRpu A==; X-IronPort-AV: E=Sophos;i="5.54,305,1534780800"; d="scan'208";a="92254293" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Sep 2018 15:30:40 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 26 Sep 2018 00:16:30 -0700 Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Sep 2018 00:30:38 -0700 From: Damien Le Moal To: linux-block@vger.kernel.org, Jens Axboe Subject: [PATCH v2] block: fix deadline elevator drain for zoned block devices Date: Wed, 26 Sep 2018 16:30:37 +0900 Message-Id: <20180926073037.29563-1-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.17.1 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 When the deadline scheduler is used with a zoned block device, writes to a zone will be dispatched one at a time. This causes the warning message: deadline: forced dispatching is broken (nr_sorted=X), please report this to be displayed when switching to another elevator with the legacy I/O path while write requests to a zone are being retained in the scheduler queue. Prevent this message from being displayed when executing elv_drain_elevator() for a zoned block device. __blk_drain_queue() will loop until all writes are dispatched and completed, resulting in the desired elevator queue drain without extensive modifications to the deadline code itself to handle forced-dispatch calls. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- Changes from v1: * Fixed typo in commit message block/elevator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/elevator.c b/block/elevator.c index 6a06b5d040e5..8cd81fd6339a 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -609,7 +609,7 @@ void elv_drain_elevator(struct request_queue *q) while (e->type->ops.sq.elevator_dispatch_fn(q, 1)) ; - if (q->nr_sorted && printed++ < 10) { + if (q->nr_sorted && printed++ < 10 && !blk_queue_is_zoned(q)) { printk(KERN_ERR "%s: forced dispatching is broken " "(nr_sorted=%u), please report this\n", q->elevator->type->elevator_name, q->nr_sorted);