Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp337725ybi; Fri, 31 May 2019 02:14:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZKS2i8aW5iJtPvTo1Lngd61mhzHbquHh/pbzRnDy6Jgfenvhmz2RP0OuXxTwqF/morcxG X-Received: by 2002:a63:6841:: with SMTP id d62mr7699205pgc.17.1559294054721; Fri, 31 May 2019 02:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559294054; cv=none; d=google.com; s=arc-20160816; b=I4hnmOUfnJDLkIV7YbXPmznMLfuCxDQALacbiBLBn0L+9QgJbgdW2ddkjeywHjqAbk 6tz/roZWPFyIC55/raehJt+KF+5Ik0OWCNQ7BbmeSpthF8I4LU3ypQb5J2j5x3MSRgNK 1arSpqdwmUJi6MCcabFoGGsrdE+ebiDYln0Ud5VFVnqPdv5djDZB2A7CdIZSqm+ll88d wT5JyELpB7Gq67HdDpY2DRQv0iyZzLN0ych/fRqgqsQRYUgCHH6UrD7RZNBHqwRYIsYg meCwTVXuWGrZj6lgkLVTLT70IPoBVXJ/WJTy5epQ5LrKjjYy1mW6n4RTkaVoDKpNPcc4 2sOA== 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=0AxDHUUpSLBZZ6pZG7HK+8YHC3CP8Xm9yOJRwOpXCuQ=; b=vYqcaYdHnKmVWekpIEyRgkbgF0A4IT5uqNMHVgshpvibwTx96DzO6eJHUty9mm3/d8 e0OqWttiHiLXjOR5YAEhC9rR5pKOtxiCKodmGYlLYOJ4QaymEpjvkLV5SwgG5lKlW78O jBeKYr25iJtxDiLAwGEAj56teDifZEO5k4WD0ms+3alQo54KehgMgtTQRW9cizJsymJA BzxN1iNJ5Zd+jZPTQOi/4NY5Ar1n2uihlIHleLtvQk7UeS2QcwPabRNq1bIYFGGOpK1u qz1rER5c3W2Atk4wMjKep4qPsUkI+U0g5Jc/8DZ5jP2yP5xW8oHS0fL3wtvjhKdPvy7M RmqA== 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 c1si5311272pgm.548.2019.05.31.02.13.56; Fri, 31 May 2019 02:14:14 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727072AbfEaJMZ (ORCPT + 99 others); Fri, 31 May 2019 05:12:25 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:33984 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbfEaJMZ (ORCPT ); Fri, 31 May 2019 05:12:25 -0400 Received: by mail-wm1-f67.google.com with SMTP id e19so7222062wme.1 for ; Fri, 31 May 2019 02:12:23 -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=0AxDHUUpSLBZZ6pZG7HK+8YHC3CP8Xm9yOJRwOpXCuQ=; b=QeYMIZwXDjIPaKPR8uRKq0HBiGZVlvezHCMtqI5QW1C+x/h8NI0vGDRtWK74kcqxIp K6Mv0VeFlBvkmqvmUAIbko08fnYYHbuJZA1t5pPmYUkbi2SMm90eZEs8fLpMjQpHjRlD lqYLWjg0VuArOirauGWU3moNeWf6jXMipEhVMD47TctpomHkaoQ8PoRV/Hmmon+XGqMx MKJA/PTevTSxZvwpZuypP/Dn1LLd3+LTnBj6GE1xnVcSZCyfzcUnZolKY8Vhuc3KN6VO bQg4KSH7inhO8n58t3PGCXwpH42KPNsHla+Xd4vEoblQrl1ANV2YICggPdGov2hRNWVk rLcA== X-Gm-Message-State: APjAAAXa4sAhl3VQeXWsJRhzy6UrOQy6gWRFTBQ/u+CNda1jPG56vAvy 4um6KpKNYHKjSjgI/dS4y5YztQ== X-Received: by 2002:a1c:808b:: with SMTP id b133mr4754979wmd.160.1559293942789; Fri, 31 May 2019 02:12:22 -0700 (PDT) Received: from [192.168.10.150] ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id t6sm10181349wmt.34.2019.05.31.02.12.21 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2019 02:12:21 -0700 (PDT) Subject: Re: [PATCH 1/2] scsi_host: add support for request batching To: Bart Van Assche , 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> <461fe0cd-c5bc-a612-6013-7c002b92dcdc@redhat.com> <740d2f33-004e-7a37-1f6e-cf29480439b1@acm.org> From: Paolo Bonzini Message-ID: Date: Fri, 31 May 2019 11:12:20 +0200 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: <740d2f33-004e-7a37-1f6e-cf29480439b1@acm.org> Content-Type: text/plain; charset=utf-8 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 30/05/19 19:54, Bart Van Assche wrote: > As far as I can see the only impact of defining an empty commit_rqs > callback on the queueing behavior is that blk_mq_make_request() will > queue requests for multiple hwqs on the plug list instead of requests > for a single hwq. The plug list is sorted by hwq before it is submitted > to a block driver. If that helps NVMe performance it should also help > SCSI performance. See the comment in blk_mq_make_request(): sorting by hwq helps NVMe because it uses bd->last, and blk_mq_make_request() uses the presence of the ->commit_rqs() as a sign that the driver uses bd->last. The heuristic basically trades latency (with plugging, the driver rings the doorbell a bit later) for throughput (ringing the doorbell is slow, so we want to do it less). If the driver doesn't use bd->last and the doorbell is always rung, plugging adds to the latency without the throughput benefit. All that the duplicate blk_mq_ops do is letting blk_mq_make_request() use the same heuristic for SCSI. This should be beneficial exactly for the reason that you mention: if the heuristic helps non-SCSI block driver performance, it should also help performance of SCSI drivers that have nr_hw_queues > 1 but no commit_rqs (lpfc, qedi, qla2xxx, smartpqi, storvsc). Paolo > How about always setting commit_rqs = scsi_commit_rqs > in scsi_mq_ops?