Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4084052img; Tue, 26 Mar 2019 02:39:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfxYiax2hnYLF94lOSO93y/K3+RnnM3LFcB0Ue3yz2UMHG2O59oVI8PzxmqSkvdTY5gIEl X-Received: by 2002:a17:902:8202:: with SMTP id x2mr23048309pln.318.1553593194612; Tue, 26 Mar 2019 02:39:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553593194; cv=none; d=google.com; s=arc-20160816; b=XfB59I/YtCgReJwztXP/tZo1eBGwRY6FpHfodTGP2104PyTYpdJ1yp6nnmh0eHO5XE fbP7iptKdfAEWJbbCw8AHHN4gMOBJwc/Br08GBxB5wKFBMIQ1yzKOIbfqyo/IM1f/vHF YOalGijHcK69Wh4qCN2XhaSPTSMDOwAqTtzKHkm2S/Dk4ajjHtZYeCHc9lLVKi6vt37n YGkt5LLy+zyoXCcbfSd85wb/WqgVu41FgV7xOU8BPyygSacXuuPGBl4W0bOfxp1gHWdL pXLBVAJRn5YuGfh4l5Q8JQ5L+AY6Q1LLQ0Tifi6ewBg/XOc5KSp1Yin9TUeiAGYBWCSS Sjmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9JBOtUryYHSUieR+7qnK45GmPxxQnA5OI7xgwospEDw=; b=n7yfrIjnppwlqrCQrGtEj7A+DUZ4gNz8FEU1zHEWLRxvSa/v9mSgwVqWZHqdcV2EDC n+v3uV5GDBRQSdVYGs1JqCHwuOxKPNhNXRQzHfllovOhUzSUHOXWw+CxZsDpoT0TuB3C 6kKQvRx7Tyx+EM25W92kGNT5GWjVICFUrnSK4JZ498grfLfVzdi8qj+8/o8GeLxOe4g6 L6N7AHoJNn5wrCrBKnzAhEATvhXst4xaZeg0i7u0sqSMVDXexwSxn4ZxZr5pa8NWHE/Q gIPq/AwBFa2LIxzzwyl8Ws1Puuhtr+hZy7BSqia3GuOz/FOtm/Tcx28H1hj0JrJxGPpt HtpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s9AVvwr+; 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 y9si15355547pgh.232.2019.03.26.02.39.39; Tue, 26 Mar 2019 02:39:54 -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=s9AVvwr+; 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 S1731179AbfCZJjC (ORCPT + 99 others); Tue, 26 Mar 2019 05:39:02 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53543 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbfCZJjC (ORCPT ); Tue, 26 Mar 2019 05:39:02 -0400 Received: by mail-wm1-f67.google.com with SMTP id q16so11811774wmj.3; Tue, 26 Mar 2019 02:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9JBOtUryYHSUieR+7qnK45GmPxxQnA5OI7xgwospEDw=; b=s9AVvwr+FotJhqfMG0m/yu3n2tRdMtm7u6kHywHkef6RZtf7XT9k+Xq1By/MheobEN 0R1sgAdC+0P4b9QRaECezRAkyYb+idK3ctFcXCKYIaXIIzzpM2OtyJU65eceKDNeHX6s qWDTrLZziaCSJKY93EKYlixgs6WzYeEh0NpG3BJbCr7aP/w8jH/G+H4nbiAx5wYMinp4 n2N2x03ei5JftlidNJfro4F0cnPLM4h9ErMRYzk9Xr4iLbCihf8U2Jy7pdsGcbh4gFwc kgIUIBEdHrj7+CFXyW5f+TGmugdGgfi1Bu4LGaIXphvxSKSCTToTQhb1yIjN21dPy/US HgHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9JBOtUryYHSUieR+7qnK45GmPxxQnA5OI7xgwospEDw=; b=cR7ORxE+sRyUPicdfbgbuBIUM4BV9CH41+28rimBTtcdvcZSoFYmjY4w2BGrNGIXXf XC8a/9ioApWjbqabDQiA6GX4ur6iuoJqkcbOkG8hl3GHsj4Q0jbmpKjdZ83tJpY9+LSN 4YK70jLs2g2cFZIItS3MbtEMhb76yYv4aGbZ4rqreRssKGsHxboKSyAm9xYT/hVmF9Wi ZP1InE2ovAxnZxBOCvtDvo2YY1/rbGuWq1Hs7Vfdh6nGaoAeLFs4JjY8f5xKzGmsFqNK 30WBeZSWZDd5aL6eFuV+Pp3ABnrajiXHO4tkBugSXO/dQShCxkLpOFtnmndh6Jj4Be1L RDPw== X-Gm-Message-State: APjAAAVPRp9jVUZqWBnvg6g+jzbizJ1Ar9nxmYYMXqtInwkaMQYJuWc0 jS+Y9+SU3bMqW8BwKQYY1Sc= X-Received: by 2002:a1c:1b10:: with SMTP id b16mr14847262wmb.90.1553593139791; Tue, 26 Mar 2019 02:38:59 -0700 (PDT) Received: from localhost ([51.15.41.238]) by smtp.gmail.com with ESMTPSA id 132sm29989820wmd.30.2019.03.26.02.38.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2019 02:38:58 -0700 (PDT) Date: Tue, 26 Mar 2019 09:38:58 +0000 From: Stefan Hajnoczi To: Maxim Levitsky Cc: linux-nvme@lists.infradead.org, Fam Zheng , Keith Busch , Sagi Grimberg , kvm@vger.kernel.org, Wolfram Sang , Greg Kroah-Hartman , Liang Cunming , Nicolas Ferre , linux-kernel@vger.kernel.org, Kirti Wankhede , "David S . Miller" , Jens Axboe , Alex Williamson , John Ferlan , Mauro Carvalho Chehab , Paolo Bonzini , Liu Changpeng , "Paul E . McKenney" , Amnon Ilan , Christoph Hellwig Subject: Re: [PATCH 0/9] RFC: NVME VFIO mediated device [BENCHMARKS] Message-ID: <20190326093858.GI21018@stefanha-x1.localdomain> References: <20190319144116.400-1-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IbA9xpzOQlG26JSn" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --IbA9xpzOQlG26JSn Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 25, 2019 at 08:52:32PM +0200, Maxim Levitsky wrote: > Hi >=20 > This is first round of benchmarks. >=20 > The system is Intel(R) Xeon(R) Gold 6128 CPU @ 3.40GHz >=20 > The system has 2 numa nodes, but only cpus and memory from node 0 were us= ed to > avoid noise from numa. >=20 > The SSD is Intel=C2=AE Optane=E2=84=A2 SSD 900P Series, 280 GB version >=20 >=20 > https://ark.intel.com/content/www/us/en/ark/products/123628/intel-optane-= ssd-900p-series-280gb-1-2-height-pcie-x4-20nm-3d-xpoint.html >=20 >=20 > ** Latency benchmark with no interrupts at all ** >=20 > spdk was complited with fio plugin in the host and in the guest. > spdk was first run in the host > then vm was started with one of spdk,pci passthrough, mdev and inside the > vm spdk was run with fio plugin. >=20 > spdk was taken from my branch on gitlab, and fio was complied from source= for > 3.4 branch as needed by the spdk fio plugin. >=20 > The following spdk command line was used: >=20 > $WORK/fio/fio \ > --name=3Djob --runtime=3D40 --ramp_time=3D0 --time_based \ > --filename=3D"trtype=3DPCIe traddr=3D$DEVICE_FOR_FIO ns=3D1" --ioengine= =3Dspdk \ > --direct=3D1 --rw=3Drandread --bs=3D4K --cpus_allowed=3D0 \ > --iodepth=3D1 --thread >=20 > The average values for slat (submission latency), clat (completion latenc= y) and > its sum (slat+clat) were noted. >=20 > The results: >=20 > spdk fio host:=20 > 573 Mib/s - slat 112.00ns, clat 6.400us, lat 6.52ms > 573 Mib/s - slat 111.50ns, clat 6.406us, lat 6.52ms >=20 >=20 > pci passthough host/ > spdk fio guest > 571 Mib/s - slat 124.56ns, clat 6.422us lat 6.55ms > 571 Mib/s - slat 122.86ns, clat 6.410us lat 6.53ms > 570 Mib/s - slat 124.95ns, clat 6.425us lat 6.55ms >=20 > spdk host/ > spdk fio guest: > 535 Mib/s - slat 125.00ns, clat 6.895us lat 7.02ms > 534 Mib/s - slat 125.36ns, clat 6.896us lat 7.02ms > 534 Mib/s - slat 125.82ns, clat 6.892us lat 7.02ms >=20 > mdev host/ > spdk fio guest: > 534 Mib/s - slat 128.04ns, clat 6.902us lat 7.03ms > 535 Mib/s - slat 126.97ns, clat 6.900us lat 7.03ms > 535 Mib/s - slat 127.00ns, clat 6.898us lat 7.03ms >=20 >=20 > As you see, native latency is 6.52ms, pci passthrough barely adds any lat= ency, > while both mdev/spdk added about (7.03/2 - 6.52) - 0.51ms/0.50ms of laten= cy. Milliseconds is surprising. The SSD's spec says 10us read/write latency. Did you mean microseconds? >=20 > In addtion to that I added few 'rdtsc' into my mdev driver to strategical= ly > capture the cycle count it takes it to do 3 things: >=20 > 1. translate a just received command (till it is copied to the hardware > submission queue) >=20 > 2. receive a completion (divided by the number of completion received in = one > round of polling) >=20 > 3. deliver an interupt to the guest (call to eventfd_signal) >=20 > This is not the whole latency as there is also a latency between the poin= t the > submission entry is written and till it is visible on the polling cpu, pl= us > latency till polling cpu gets to the code which reads the submission entr= y, > and of course latency of interrupt delivery, but the above measurements m= ostly > capture the latency I can control. >=20 > The results are: >=20 > commands translated : avg cycles: 459.844 avg time(usec): 0.135 = =20 > commands completed : avg cycles: 354.61 avg time(usec): 0.104 = =20 > interrupts sent : avg cycles: 590.227 avg time(usec): 0.174 >=20 > avg time total: 0.413 usec >=20 > All measurmenets done in the host kernel. the time calculated using tsc_k= hz > kernel variable. >=20 > The biggest take from this is that both spdk and my driver are very fast = and > overhead is just a thousand of cpu cycles give it or take. Nice! Stefan --IbA9xpzOQlG26JSn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcmfMyAAoJEJykq7OBq3PIT0MIAJYLZBHOV0P0U3MIboeVwzch qNEL1zQEm00Y8d1t7MtdTmY7F/6YXZ03yDsfFFdfqbHHAMMJPja9f/nS+gyUfUO6 kKNzXuX6XQy9B+U62mMOQcOLcNQ5cXF0j8/SauJOWC8vle1f4UAi6CBDdCKj58Hi 8Moouk9TRHryTOEdoupLL7aWCzxAo7yic9VLw5+5uaGpnrc/oxOq94jWzQKjRZzv 61KyFMSWopG9AOd2fCEWDTmGKORlGKqSQDnB2vrwkflQxrBrsF+ZNN7f1sOXrvb6 iwa44IC1Tp9hSvxYZJ441uQPVAUOv71rNsVsYADl5mcGxr5sr5NxaGq38U2tQG8= =C0a6 -----END PGP SIGNATURE----- --IbA9xpzOQlG26JSn--