Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp330135ybi; Fri, 31 May 2019 02:06:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqytPcS/zuqezk8bHiQrrgD7cxX1yttpXZ9tgYSDF5RvNO/sGn8zD63rT3qyynOpGo3ebEkj X-Received: by 2002:a17:90a:5d15:: with SMTP id s21mr7733049pji.126.1559293588878; Fri, 31 May 2019 02:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559293588; cv=none; d=google.com; s=arc-20160816; b=OUFVhzGVbUYtF+24JiP+Xn0yvC6wmpi6DcnyxDpUEulfRC2CSfShTCePNJHj2EwPin M9cY4r/UOP8RddtaWLa9WCLK/SDK1GiH0s0U1DgYYZ2Uz2p1FTqS3xaKP4egVcwHFENM WL6xP0WrpF/6tv3gRt9wddJRjB6F/a2C4wPm6r99Ya+wRy24+wBfOg062Yl1HjHXLeel 1VL2zubmV6fEMY56bXLXjMjN8Nym5ZLnYtag0DdeIZa+GzaPtfUPMtAJRyjWvscgTvrA MDi4lbetqEYFCNbjjG5+1ep9QFPkINI9Kx36IC8DVkAlzngfLM92BGT5FtU91qfQ8eiD MGjA== 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=HRebP66JW4IyuOF0hDBqAwbwyYWxhmEAnf33J7IdOA0=; b=0vtm1XlpfAspzDXFC3Twvnc+Bj9R4+3ofSiWhKHLtWgxlKar81c7wZsjiNOeT3fk2Y q/W3bVwTBA0Ve6LVGaW224fGW2dHhRQjctYBoAmWJlgU+M7NUFOfYZJdjRFco94Vd+9h 96akLdotQubxsloqKsJARFApigHYKlfvZhTmY+MllzhYacupjmUnNRLJdIfXHyqOmmO+ wvFHGkY+2P5K3V8boVydLP7XZjGTGDc0e7Gd6zxxl1uMlGFHt+qtKTgy6uti9QtiFZbr BkKs21cBr8osKhF5Y4oJU73GTbP8I/x/0eDNlJagHnPhIYDL7lCruuUJVloI5l5MMkrZ q7gw== 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 14si5949986pfu.76.2019.05.31.02.06.11; Fri, 31 May 2019 02:06:28 -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 S1727138AbfEaJDU (ORCPT + 99 others); Fri, 31 May 2019 05:03:20 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46108 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726693AbfEaJDT (ORCPT ); Fri, 31 May 2019 05:03:19 -0400 Received: by mail-wr1-f65.google.com with SMTP id n4so724342wrw.13 for ; Fri, 31 May 2019 02:03:18 -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=HRebP66JW4IyuOF0hDBqAwbwyYWxhmEAnf33J7IdOA0=; b=pPHz49befugaJLF76GxzeDIJp9i/Fzf84Tz4Tjoxznr0ZiKp7P0MhIzHrHRdPKEt6K nstVyr/R21vPvoxKQgH+kF8mieBSqJamJ4OZtq0YaaBkLlLwSXsvdDwM5Wb9Yad8kEOu WVboWuD1yQjGehbuNkxIi3XHr484m86ib1UPrSQZzTvNtnYPU+69ZYEtDSj/p/81L5Lq +wrTLk5JpQNh61mV5wCqwKI3Ekz1C7uXS8POk0RFhfRgzEh25RNiQnoi5I9H/Ly7Qw6J FLKScGNU+zJxJQIbF1IYrzkOZNOiYk1jaCWWZKldVJ4qws99AllTzl/b/BkBxVGvL68c MJtA== X-Gm-Message-State: APjAAAXVyL66AS0fnLk0TbRXydVTQ3ukRrRPdaSk/dZu27ZdtGGBS/ga ovUgu17+h07VJUzo03ZzfGeaFA== X-Received: by 2002:adf:f909:: with SMTP id b9mr5874103wrr.119.1559293398234; Fri, 31 May 2019 02:03:18 -0700 (PDT) Received: from [192.168.10.150] ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id t6sm10141754wmt.34.2019.05.31.02.03.17 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2019 02:03:17 -0700 (PDT) Subject: Re: [PATCH 2/2] virtio_scsi: implement 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-3-pbonzini@redhat.com> <79490df1-0145-5b40-027a-7e8fb96854d4@acm.org> From: Paolo Bonzini Message-ID: Date: Fri, 31 May 2019 11:03:16 +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: <79490df1-0145-5b40-027a-7e8fb96854d4@acm.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/05/19 19:28, Bart Van Assche wrote: > On 5/30/19 4:28 AM, Paolo Bonzini wrote: >> @@ -531,7 +547,8 @@ static int virtscsi_queuecommand(struct Scsi_Host >> *shost, >>           req_size = sizeof(cmd->req.cmd); >>       } >>   -    ret = virtscsi_kick_cmd(req_vq, cmd, req_size, >> sizeof(cmd->resp.cmd)); >> +    kick = (sc->flags & SCMD_LAST) != 0; >> +    ret = virtscsi_add_cmd(req_vq, cmd, req_size, >> sizeof(cmd->resp.cmd), kick); > > Have you considered to have the SCSI core call commit_rqs() if bd->last > is true? I think that would avoid that we need to introduce the > SCMD_LAST flag and that would also avoid that every SCSI LLD that > supports a commit_rqs callback has to introduce code to test the > SCMD_LAST flag. That is slightly worse for performance, as it unlocks and re-locks the spinlock. Paolo