Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4631327imm; Mon, 15 Oct 2018 19:27:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV61Nxu2yyPg6EPgr9360+PggDY+SGdG1L333YMKacV+4mIB1TxDN96ufCfnQiAxRHGINrRqi X-Received: by 2002:a63:d945:: with SMTP id e5-v6mr18427330pgj.24.1539656834081; Mon, 15 Oct 2018 19:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539656834; cv=none; d=google.com; s=arc-20160816; b=VgWTN6fN5Doe/d92s+0izaJ0dEUBwUzSUJFR5aerVbOhrJTTrw4cBUrxPdR12Pw0ev ipwgolzxbwcQuUa5/GxZ/fQ6jsAp+m0bGBWXSuWeEuet2WF6S2Y33lY68/3i2OGqaZzH /KUYBF0N1KF/a6qFDjpzNJJg8MDGOidBqTMYhOyP0nOZrAZmaEkmFGiQelYV1XbPgPqf QvKzHv7xkDMJfpKKEMc3xtKkTGPpwPEL/+5ke40sgP+FNqR1lBUVc/yfeEsAI5Qm3ujA 3HXgmeJDv1g9MRgTyiplZl10HNd0NeE+KXkEfcVap0iXTvGAB9WUtu50szvIY7Y0gY3y BWCQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=OH2uVsRzY0fMDKD79VxDM7NUq0AJ6Gr9BODRXlDwNwk=; b=l5sgSOMcpUhguRtNjS0u6QSPVeGBIijM12+SxTiyIiJw6C+2fHr4xYuYaxEKy5E1P9 RoB0xINK8sPTgtaq5xF4lk1OhWdVxMk1wi3SJdF+9tgWUHz0M/yfWHIZMw+Ihr5dx7qI 0Uo/JusuG9dFUeCqsS4hor1H5iZeyx7QDTN23lH7i3fPrXPliofVxbMAe6lpDxCO/Yfk EVcGDKY6em5l7yXQ7l6nS6Oqrp0TWtUamySHGHn53cXM04q3Cra5zZBPDB0opn7aIsX3 jjUssgSarNa2ryJEn9OZEZ0EB2JcxPiTIKdZVRl5hXcAT4+j6qKG1hP57hB2qtj34NVf Y2Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="c/mKHIS5"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i190-v6si11546278pge.83.2018.10.15.19.26.58; Mon, 15 Oct 2018 19:27: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="c/mKHIS5"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727067AbeJPKOh (ORCPT + 99 others); Tue, 16 Oct 2018 06:14:37 -0400 Received: from mail-pf1-f177.google.com ([209.85.210.177]:45255 "EHLO mail-pf1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726982AbeJPKOh (ORCPT ); Tue, 16 Oct 2018 06:14:37 -0400 Received: by mail-pf1-f177.google.com with SMTP id u12-v6so10613751pfn.12; Mon, 15 Oct 2018 19:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=OH2uVsRzY0fMDKD79VxDM7NUq0AJ6Gr9BODRXlDwNwk=; b=c/mKHIS50jeg9nqTecxD1FBmMzMa2TJGwoRNctAo03zWbGiKIJELPtbOyq8CYhgf3v tYMpYaHrsPJmrwMVwAUyzkWnAaQxFhlMFvDbVeMC3BtjdnTcVZgYH2n0JQYLfIPAZPc7 4AeCoB8M9bw4yst7w/gupmDBBsacGeFyMn2rwTzpJDIzosWmXaaJrupMxkumBgbdFQGH 7ChRYVY5jTiNeMObdSSvQgGo7JbSk/YN0icH+0JmLIWMMEb1CwRXSHYYeOev5GHkG9Dy s2V2kbTWdxL979OqJdUAfWXnSyPK61ovTZqgOidf7uIDgbxjzxdkS7aN08FPKqmHpLIn UJsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=OH2uVsRzY0fMDKD79VxDM7NUq0AJ6Gr9BODRXlDwNwk=; b=I3K0LvSocjNEHn1Pego/0iSAtFXUf7ZvVZMtqplQgRfbaz6sSIwCEPZsnEYQKFt7ks BJeC4G0XskrTD2/ewbI0H5sRCV/dTt0O/fasP3gZY2I8+KFavcUpvJ/ylRJD1YaPKKEl V7vsx0tVBD0WbhL7/AoEQYIG+soyI+mdOZKJ9fFrBVUiaijN6pCIH1HfRz3e92cqdrHn EM7kMP99ipReOb/wAOhxOpnNT0G8kA+PnUAoJRjlxXqTKtcWeZTJA6hfqGxJTRVtA2Xa Pf47ZcNkszG7vyMegVUP+BthOh7Kr783RloWnXt5Y0Aa7jVHOdwuvO1pswNHkZO07U5A iyIw== X-Gm-Message-State: ABuFfohRKwWuLx53t/ps2ur+zCFaAXbEEGsDuCxxhF2jo7n02qkeb3Gj 0N6yux/7Pqul8o0teM5umza25E2C3wrr7UFDTe0vWyganO9XYQ== X-Received: by 2002:a63:cd12:: with SMTP id i18-v6mr18714771pgg.319.1539656795007; Mon, 15 Oct 2018 19:26:35 -0700 (PDT) MIME-Version: 1.0 References: <20181001114146.GA2508@work-vm> <20181015185115.GA3247@grmbl.mre> In-Reply-To: <20181015185115.GA3247@grmbl.mre> From: Feng Li Date: Tue, 16 Oct 2018 10:26:08 +0800 Message-ID: Subject: Re: [Qemu-devel] virtio-console downgrade the virtio-pci-blk performance To: amit@kernel.org Cc: dgilbert@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel , qemu-discuss@nongnu.org, qemu-devel@nongnu.org, "linux-scsi@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Amit, Thanks for your response. See inline comments. Amit Shah =E4=BA=8E2018=E5=B9=B410=E6=9C=8816=E6=97=A5=E5= =91=A8=E4=BA=8C =E4=B8=8A=E5=8D=882:51=E5=86=99=E9=81=93=EF=BC=9A > > On (Thu) 11 Oct 2018 [18:15:41], Feng Li wrote: > > Add Amit Shah. > > > > After some tests, we found: > > - the virtio serial port number is inversely proportional to the iSCSI > > virtio-blk-pci performance. > > If we set the virio-serial ports to 2(" > type=3D'virtio-serial' index=3D'0' ports=3D'2'/>), the performance down= grade > > is minimal. > > If you use multiple virtio-net (or blk) devices -- just register, not > necessarily use -- does that also bring the performance down? I Yes. We just register the virtio-serial, and not use it, it brings the virtio-blk performance down. > suspect it's the number of interrupts that get allocated for the > ports. Also, could you check if MSI is enabled? Can you try with and > without? Can you also reproduce if you have multiple virtio-serial > controllers with 2 ports each (totalling up to whatever number that > reproduces the issue). This is the full cmd: /usr/libexec/qemu-kvm -name guest=3D6a798fde-c5d0-405a-b495-f2726f9d12d5,debug-threads=3Don -machine pc-i440fx-rhel7.5.0,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff -cpu host -= m size=3D2097152k,slots=3D255,maxmem=3D4194304000k -uuid 702bb5bc-2aa3-4ded-86eb-7b9cf5c1e2d9 -drive file.driver=3Discsi,file.portal=3D127.0.0.1:3260,file.target=3Diqn.2016-02.= com.smartx:system:zbs-iscsi-datastore-1537958580215k,file.lun=3D74,file.tra= nsport=3Dtcp,format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk0,cache=3Dnone,ai= o=3Dnative -device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-virt= io-disk0,id=3Dvirtio-disk0,bootindex=3D1,write-cache=3Don -drive file.driver=3Discsi,file.portal=3D127.0.0.1:3260,file.target=3Diqn.2= 016-02.com.smartx:system:zbs-iscsi-datastore-1537958580215k,file.lun=3D182,= file.transport=3Dtcp,format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk1,cache= =3Dnone,aio=3Dnative -device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Ddrive-virt= io-disk1,id=3Dvirtio-disk1,bootindex=3D2,write-cache=3Don -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x8 -vnc 0.0.0.0:100 -netdev user,id=3Dfl.1,hostfwd=3Dtcp::5555-:22 -device e1000,netdev=3Dfl.1 -msg timestamp=3Don -device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x5 qemu version: qemu-kvm-2.10.0-21 I guess the MSI is enabled, I could see some logs: [ 2.230194] acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM Segments MS= I] [ 3.556376] virtio-pci 0000:00:05.0: irq 24 for MSI/MSI-X The issue could reproduce easily, using one virtio-serial with 31 ports, and this is the default port num. I think it's not necessary to reproduce with multiple controllers. > > Amit > > > > > - use local disk/ram disk as virtio-blk-pci disk, the performance > > downgrade is still obvious. > > > > > > Could anyone give some help about this issue? > > > > Feng Li =E4=BA=8E2018=E5=B9=B410=E6=9C=881=E6=97= =A5=E5=91=A8=E4=B8=80 =E4=B8=8B=E5=8D=8810:58=E5=86=99=E9=81=93=EF=BC=9A > > > > > > Hi Dave, > > > My comments are in-line. > > > > > > Dr. David Alan Gilbert =E4=BA=8E2018=E5=B9=B410= =E6=9C=881=E6=97=A5=E5=91=A8=E4=B8=80 =E4=B8=8B=E5=8D=887:41=E5=86=99=E9=81= =93=EF=BC=9A > > > > > > > > * Feng Li (lifeng1519@gmail.com) wrote: > > > > > Hi, > > > > > I found an obvious performance downgrade when virtio-console comb= ined > > > > > with virtio-pci-blk. > > > > > > > > > > This phenomenon exists in nearly all Qemu versions and all Linux > > > > > (CentOS7, Fedora 28, Ubuntu 18.04) distros. > > > > > > > > > > This is a disk cmd: > > > > > -drive file=3Discsi://127.0.0.1:3260/iqn.2016-02.com.test:system:= fl-iscsi/1,format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk0,cache=3Dnone,aio= =3Dnative > > > > > -device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3D= drive-virtio-disk0,id=3Dvirtio-disk0,bootindex=3D1,write-cache=3Don > > > > > > > > > > If I add "-device > > > > > virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x5 ", = the virtio > > > > > disk 4k iops (randread/randwrite) would downgrade from 60k to 40k= . > > > > > > > > > > In VM, if I rmmod virtio-console, the performance will back to no= rmal. > > > > > > > > > > Any idea about this issue? > > > > > > > > > > I don't know this is a qemu issue or kernel issue. > > > > > > > > It sounds odd; can you provide more details on: > > > > a) The benchmark you're using. > > > I'm using fio, the config is: > > > [global] > > > ioengine=3Dlibaio > > > iodepth=3D128 > > > runtime=3D120 > > > time_based > > > direct=3D1 > > > > > > [randread] > > > stonewall > > > bs=3D4k > > > filename=3D/dev/vdb > > > rw=3Drandread > > > > > > > b) the host and the guest config (number of cpus etc) > > > The qemu cmd is : /usr/libexec/qemu-kvm --device virtio-balloon -m 16= G > > > --enable-kvm -cpu host -smp 8 > > > or qemu-system-x86_64 --device virtio-balloon -m 16G --enable-kvm -cp= u > > > host -smp 8 > > > > > > The result is the same. > > > > > > > c) Why are you running it with iscsi back to the same host - why = not > > > > just simplify the test back to a simple file? > > > > > > > > > > Because my ISCSI target could supply a high IOPS performance. > > > If using a slow disk, the performance downgrade would be not so obvio= us. > > > It's easy to be seen, you could try it. > > > > > > > > > > Dave > > > > > > > > > > > > > > Thanks in advance. > > > > > -- > > > > > Thanks and Best Regards, > > > > > Alex > > > > > > > > > -- > > > > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK > > > > > > > > > > > > -- > > > Thanks and Best Regards, > > > Feng Li(Alex) > > > > > > > > -- > > Thanks and Best Regards, > > Feng Li(Alex) > > Amit > -- > http://amitshah.net/ --=20 Thanks and Best Regards, Feng Li(Alex)