Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6456290imu; Wed, 14 Nov 2018 01:36:34 -0800 (PST) X-Google-Smtp-Source: AJdET5csXzOQXvmVfmLAw+spXmo5uQhSwkHhjsDqkQmYyZH7ODK8wMG+t5SS5JCRUfcFy95vGLnu X-Received: by 2002:a17:902:b091:: with SMTP id p17-v6mr1170672plr.222.1542188194449; Wed, 14 Nov 2018 01:36:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542188194; cv=none; d=google.com; s=arc-20160816; b=qX0HAUhGD+g+VNlbwLHzpXcnh3fPPHOg5YbjwuPsVq8Um6U/dnayRhKmHW7mMyfNfU qrhnBuHKVKnHdMsnxyYZVqEl075yOGA4QOjGDiIm05jIu+YR9mXiHzZundqjD9ve65Cj GDUJUPHuPqQEeuxufHG0fzSny8gr3CD/uDU7WYemMIltb/XGWs2qzBh27JFwv4UxEjoZ 7jworsT4B3mg2oelz51Xls2xvMg2VcWv17ZEZ6PSjb6SIQYxrHmcMQlCAaXEPLMiHhe2 DwbQreTBKykgKZHT1CFeWn+aRvkkyRroL0OgZpnM7/6YhBC1AAgtDMA/aMS9XnqWV6hR 66Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=OvxhtYjv3umwbQcuOJS0RpNOQy2UQCc4ZJPI+x1KEnE=; b=jLBfRPNh3ZSjnclop2z0GUYHk5aYlIzXkeLkEebfl4qjezaqE0Cq8jpDJ1Ixu48biV DxJzFcxMvvlwn8JwVMf5ZU4Iy366KvNV4PX+gvQyXa2pnbEhSgqmL7weuYGBV1CO3VQn 4qqGYXQ3Gke4hU/AOYpAPF7P8jV5S5IB9y5xGpczE8uywucM3ejbsvk6LJjl1QezFow4 qmxkI69v4Mp0EkwnAL0qHCT+MMljmeYCaXmtv/wJJq1AaFvvfL+1c8hH5e/efz6Zj1+s 7of2UvBxGGld+HXvhRT0/8tJfsiE3SEEDuHgEanqpVF6MB+m2b9ruzEhe0H9Ou094WNO M05w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4-v6si22851188plo.69.2018.11.14.01.36.18; Wed, 14 Nov 2018 01:36:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728067AbeKNTi0 (ORCPT + 99 others); Wed, 14 Nov 2018 14:38:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55756 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727558AbeKNTi0 (ORCPT ); Wed, 14 Nov 2018 14:38:26 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 64A71307A281; Wed, 14 Nov 2018 09:35:58 +0000 (UTC) Received: from ming.t460p (ovpn-8-18.pek2.redhat.com [10.72.8.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B73B60BF7; Wed, 14 Nov 2018 09:35:50 +0000 (UTC) Date: Wed, 14 Nov 2018 17:35:46 +0800 From: Ming Lei To: "jianchao.wang" Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V7 2/4] blk-mq: fix issue directly case when q is stopped or quiesced Message-ID: <20181114093544.GD20550@ming.t460p> References: <1542185131-15029-1-git-send-email-jianchao.w.wang@oracle.com> <1542185131-15029-3-git-send-email-jianchao.w.wang@oracle.com> <20181114092022.GC20550@ming.t460p> <6b29fb1a-31bc-ac3e-cdbd-80b2a9c95e11@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6b29fb1a-31bc-ac3e-cdbd-80b2a9c95e11@oracle.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 14 Nov 2018 09:35:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 14, 2018 at 05:29:54PM +0800, jianchao.wang wrote: > Hi Ming > > On 11/14/18 5:20 PM, Ming Lei wrote: > > On Wed, Nov 14, 2018 at 04:45:29PM +0800, Jianchao Wang wrote: > >> When try to issue request directly, if the queue is stopped or > >> quiesced, 'bypass' will be ignored and return BLK_STS_OK to caller > >> to avoid it dispatch request again. Then the request will be > >> inserted with blk_mq_sched_insert_request. This is not correct > >> for dm-rq case where we should avoid to pass through the underlying > >> path's io scheduler. > >> > >> To fix it, use blk_mq_request_bypass_insert to insert the request > >> to hctx->dispatch when we cannot pass through io scheduler but have > >> to insert. > > > > Not sure if the current behaviour is wrong, or worth of a fix. > > > > Bypassing io scheduler for dm-rq is only for sake of performance > > because there has been io scheduler for dm device already, and we > > just don't want to schedule these requests twice. > > As comment of commit 157f377beb710e84bd8bc7a3c4475c0674ebebd7 > (block: directly insert blk-mq request from blk_insert_cloned_request()) > > All said, a request-based DM multipath device's IO scheduler should be > the only one used -- when the original requests are issued to the > underlying paths as cloned requests they are inserted directly in the > underlying dispatch queue(s) rather than through an additional elevator. > > But commit bd166ef18 ("blk-mq-sched: add framework for MQ capable IO > schedulers") switched blk_insert_cloned_request() from using > blk_mq_insert_request() to blk_mq_sched_insert_request(). Which > incorrectly added elevator machinery into a call chain that isn't > supposed to have any. > > It sounds like a wrong action. As I mentioned, it is only for the sake of performance, and IO scheduler has to be supported on these devices too, for example, one partition may be under dm-rq, and another partition can be accessed directly. However, you are fixing the handling when queue is quiesced or stopped. Under this situation, it is fine to put requests into scheduler queue, given no performance need to be worried. Thanks, Ming