Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp89008ybk; Fri, 8 May 2020 14:51:04 -0700 (PDT) X-Google-Smtp-Source: APiQypLIcOod8GKysiWMp0I1T5HAxXyT6nUna8bULeudIozoQSVCZHoxF4J+sw9ghFBxhiF8PqHS X-Received: by 2002:a05:6402:286:: with SMTP id l6mr4047098edv.134.1588974663943; Fri, 08 May 2020 14:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588974663; cv=none; d=google.com; s=arc-20160816; b=YZHnXokEIQtGtF94L+w47mon5GY7GcbcOnorXDULyJLoamx30/ZVcfAn3KHd4f1zRs leyfNjJ4Eb2VMfEY4myqhy2A5l6LRPWmd+0nK19NRtm6vGye0NxagzDZUHtdhoQq1uou dLT7fuY9Hg3e9djDmvJZYQ/WCeVPm+qKq/0trblB13EaT+zxh6HTzcxvtzOkIhQTV8Lu iw3mit/jQAyOZj4dgCu1uVz+KnZY6ZBQW6SqwohQlqu44MWsXgbR1ORPh3FsJMPSRFFy DTOvT1++oPLmb26Ph/TKEXyVmWIl7sEkxvVLGgEwsWO8hNC1XdcVA9bOUT6zEg6h1E4Q XwGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=D2IduH1CF5NRPIpQWbLKTdLk97fqdqm/1QiS9bCgssc=; b=M/JYukx4XP5R/dcyZkg8RhGOwOcCWRc8f4kQQuzuYihr2PXKnP85+h1tYawXfjH7UZ LtdkbpsTSTE4j53TPIwZZ6Go3kh6uw732PxpE/83l+5r5Cb/RU51BGnohv0rzaT4UZ+I B6Z7p1YPyHkT95eToNkarZk4QB5Lf1Jg0wLwYD/enRL5/WSZbSxItqwYqFTHLn8lQG3b duzdpZ6srcLX/d8QAvyTNpYlp2t9AbVq1HEaL8eON7zYwDIE/hOx8LlnCzuG7Z7n2h5q H3bHYePDF9hH5oJsQ2PKGG7M/kxXzOlqEW2qjf0nAhbEPVaKfmHRHiwvK6JyWHmaa6pp 0kRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BYaACNZh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f15si1652216ejf.515.2020.05.08.14.50.41; Fri, 08 May 2020 14:51:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BYaACNZh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728065AbgEHVrE (ORCPT + 99 others); Fri, 8 May 2020 17:47:04 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26107 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726811AbgEHVrB (ORCPT ); Fri, 8 May 2020 17:47:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588974420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=D2IduH1CF5NRPIpQWbLKTdLk97fqdqm/1QiS9bCgssc=; b=BYaACNZhYUh99iR3p7ZXCfVknBiOQ/bs57BD/qT+kyCa8xAAGjgzt9HNWwS2g5hCZvSG3c comQdY3QAX63R/H2MIMBZNCOBVpeylULumdbj2Egf32liKuXUhg1coJs3gQrIy1n3ui0ni CY1yyezSsyRXL2WZ+kFOrpDWKVvHuVA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-371-4mcOx4jwMjuckTDZW4qamQ-1; Fri, 08 May 2020 17:46:56 -0400 X-MC-Unique: 4mcOx4jwMjuckTDZW4qamQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6534E80183C; Fri, 8 May 2020 21:46:54 +0000 (UTC) Received: from T590 (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E36C70467; Fri, 8 May 2020 21:46:44 +0000 (UTC) Date: Sat, 9 May 2020 05:46:39 +0800 From: Ming Lei To: Sagi Grimberg Cc: Christoph Hellwig , Baolin Wang , axboe@kernel.dk, ulf.hansson@linaro.org, adrian.hunter@intel.com, arnd@arndb.de, linus.walleij@linaro.org, paolo.valente@linaro.org, orsonzhai@gmail.com, zhang.lyra@gmail.com, linux-mmc@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 1/7] block: Extand commit_rqs() to do batch processing Message-ID: <20200508214639.GA1389136@T590> References: <20200427154645.GA1201@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 08, 2020 at 02:35:35PM -0700, Sagi Grimberg wrote: > > > > diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h > > > index f389d7c724bd..6a20f8e8eb85 100644 > > > --- a/include/linux/blk-mq.h > > > +++ b/include/linux/blk-mq.h > > > @@ -391,6 +391,7 @@ struct blk_mq_ops { > > > enum { > > > BLK_MQ_F_SHOULD_MERGE = 1 << 0, > > > BLK_MQ_F_TAG_SHARED = 1 << 1, > > > + BLK_MQ_F_FORCE_COMMIT_RQS = 1 << 3, > > > > Maybe BLK_MQ_F_ALWAYS_COMMIT might be a better name? Also this > > flag (just like the existing ones..) could really use a comment > > explaining it. > > Would it make sense to elevate this flag to a request_queue flag > (QUEUE_FLAG_ALWAYS_COMMIT)? request queue flag usually is writable, however this case just needs one read-only flag, so I think it may be better to make it as tagset/hctx flag. > > I'm thinking of a possibility that an I/O scheduler may be used > to activate this functionality rather than having the driver set > it necessarily... Could you explain a bit why I/O scheduler should activate this functionality? batching submission may be good for some drivers, and currently we only do it in limited way. One reason is that there is extra cost for full batching submission, such as this patch requires one extra .commit_rqs() for each dispatch, and lock is often needed in this callback. IMO it can be a win for some slow driver or device, but may cause a little performance drop for fast driver/device especially in workload of not-batching submission. Thanks, Ming