Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5960046ybi; Tue, 4 Jun 2019 15:41:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSKUZkxXlKzJyJLQ3ZpHnCTGwoMQPOn7RqB+xBBbT2CAD3F7cEJLS5fcbCflA4Xsljemce X-Received: by 2002:aa7:83d0:: with SMTP id j16mr24492407pfn.208.1559688105752; Tue, 04 Jun 2019 15:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559688105; cv=none; d=google.com; s=arc-20160816; b=GaQAWaDc6GtrFC3dGNI1HCq9aX88sJvFWtmrFUfODVoWC+EwisH1gG3j7Tz/ShuhNN PeJCFn0E5GTR7PxBBi5ssZ9wSsAbSh3SYs3lClj+jJUaCVRV9uozfD5BghHFEpD+b2WD 8irMCLkXXzhpElbiCZjJeZ2RJw9JbQ0O455r6AdFyJeFW4Spk5nZ5uxyfbCUQGKjvi9n S4yiDK0c7B98zW175LibC94laDjqlMg0RWb7XQZ4YBXL6vcuwFcpeqI4t45HuyMCJ2Ow NgIhm0xa+EeacRFwkTf/rMGyMZ9u0q05mmNL319BKg8QTfXSUEWtig6Bhuh+VZISHaf6 bvjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1Aw/iJs+AOiEaavB7sKDwC9ReJ1P0mis+S4Hs1ITT4s=; b=Hf3BZjUTD4hAtN4HcasYjAAFwutYh/GkkOSP9U2GBQ8rliW99TTj4YCXF0Ao5I7WQD x83E07ovbEQMcLZRkIVHCXy/5jgvETCGEFRBrIdntG2TKoFSa/Xq+3MJ6ln7TlsEBniP /0X3dFIYhFrJzjzqXvKEuCm/fZAYui4p9xPGp3x9Iofd6TFHNtSixZNjSFwnm0h23hzW FBnsWcF5XxdP5uJCwnhpT8jJ8dpJLhxjkjEd+Dz/uoC5AJEhhMsgG4QoIOfmHrTjVL7Z q+aVPpaAnHVT7IQEpKrSILWa/Y4HA4dp58pu8PhhgBLi9zKF6eo0YG9ZvWMteyhwja26 UUsg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k71si7077394pje.29.2019.06.04.15.41.29; Tue, 04 Jun 2019 15:41:45 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726551AbfFDWkW (ORCPT + 99 others); Tue, 4 Jun 2019 18:40:22 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:44460 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbfFDWkV (ORCPT ); Tue, 4 Jun 2019 18:40:21 -0400 Received: by mail-pl1-f194.google.com with SMTP id c5so8904776pll.11; Tue, 04 Jun 2019 15:40:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1Aw/iJs+AOiEaavB7sKDwC9ReJ1P0mis+S4Hs1ITT4s=; b=ocPJNDGSew1IAOKWCKFWr79Te0dbmO0g/k8qf5Q4MoluLA2Hf+06JLCfX/L74pFi9t BF+vN5tOnL+0uG48KHjElCC+pKRo9zzoNK5TUSflL7aNiEL3uW1P2/ELcAN3UwDmUMks SQwOND4IYQOa5Gf2sqP769bAyycSUQ47rulFIuVNmpWkrBCggQ0mqrpZGzNuveQoIZ4w sTvm4g2KvRsY84btLaxNxAjJV5UCOqyBnXXuWDce0/4qrfCwiuF1pACA8eFGChdiabGO Ly10i3ez9A5FDnsbQVFzXo75lD5xo85gMCHKRlUbCRCaOrCgb3yYgY+WDtq6/PTi7ZMc YuZA== X-Gm-Message-State: APjAAAWo2BGkuiyKJKIbmfF+VBbdnsXH32L9tlbOnymzsRy4Jh+XNUYU 7+ex89JbzqSKsVX+fYznsIIldW7x X-Received: by 2002:a17:902:b102:: with SMTP id q2mr29846224plr.149.1559688020767; Tue, 04 Jun 2019 15:40:20 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id s1sm15129820pgp.94.2019.06.04.15.40.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 15:40:19 -0700 (PDT) Subject: Re: [PATCH 1/2] scsi_host: add support for request batching To: Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, stefanha@redhat.com References: <20190530112811.3066-1-pbonzini@redhat.com> <20190530112811.3066-2-pbonzini@redhat.com> From: Bart Van Assche Message-ID: Date: Tue, 4 Jun 2019 15:40:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190530112811.3066-2-pbonzini@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/30/19 4:28 AM, Paolo Bonzini wrote: > This allows a list of requests to be issued, with the LLD only writing > the hardware doorbell when necessary, after the last request was prepared. > This is more efficient if we have lists of requests to issue, particularly > on virtualized hardware, where writing the doorbell is more expensive than > on real hardware. > > The use case for this is plugged IO, where blk-mq flushes a batch of > requests all at once. > > The API is the same as for blk-mq, just with blk-mq concepts tweaked to > fit the SCSI subsystem API: the "last" flag in blk_mq_queue_data becomes > a flag in scsi_cmnd, while the queue_num in the commit_rqs callback is > extracted from the hctx and passed as a parameter. > > The only complication is that blk-mq uses different plugging heuristics > depending on whether commit_rqs is present or not. So we have two > different sets of blk_mq_ops and pick one depending on whether the > scsi_host template uses commit_rqs or not. Reviewed-by: Bart Van Assche