Re: [PATCH] vhost-blk: Add vhost-blk support v6

2015-07-14 Thread Ming Lin
On Sat, Dec 1, 2012 at 5:33 PM, Asias He as...@redhat.com wrote: vhost-blk is an in-kernel virito-blk device accelerator. Due to lack of proper in-kernel AIO interface, this version converts guest's I/O request to bio and use submit_bio() to submit I/O directly. So this version any supports

[PATCH -kernel] nvme: improve performance for virtual NVMe devices

2015-11-17 Thread Ming Lin
--time_based --name=benchmark --runtime=30 --filename=/dev/nvme0n1 --nrfiles=1 --ioengine=libaio --iodepth=32 --direct=1 --invalidate=1 --verify=0 --verify_fatal=0 --numjobs=4 --rw=randread --blocksize=4k --randrepeat=false Signed-off-by: Rob Nelson <rlnel...@google.com> [mlin: port for

[RFC PATCH 0/2] Google extension to improve qemu-nvme performance

2015-11-17 Thread Ming Lin
Hi Rob & Mihai, I wrote vhost-nvme patches on top of Christoph's NVMe target. vhost-nvme still uses mmio. So the guest OS can run unmodified NVMe driver. But the tests I have done didn't show competitive performance compared to virtio-blk/virtio-scsi. The bottleneck is in mmio. Your nvme vendor

[PATCH -qemu] nvme: support Google vendor extension

2015-11-17 Thread Ming Lin
different tree; added VID/DID params] Signed-off-by: Keith Busch <keith.bu...@intel.com> [mlin: port for upstream] Signed-off-by: Ming Lin <m...@kernel.org> --- hw/block/nvme.c | 92 ++--- hw/block/nvme.h | 18 +++ 2 f

Re: [RFC PATCH 0/2] virtio nvme

2015-09-10 Thread Ming Lin
On Thu, 2015-09-10 at 14:02 +, Keith Busch wrote: > On Wed, 9 Sep 2015, Ming Lin wrote: > > The goal is to have a full NVMe stack from VM guest(virtio-nvme) > > to host(vhost_nvme) to LIO NVMe-over-fabrics target. > > > > Now there are lots of duplicated

Re: [RFC PATCH 0/2] virtio nvme

2015-09-10 Thread Ming Lin
On Thu, 2015-09-10 at 15:38 +0100, Stefan Hajnoczi wrote: > On Thu, Sep 10, 2015 at 6:48 AM, Ming Lin <m...@kernel.org> wrote: > > These 2 patches added virtio-nvme to kernel and qemu, > > basically modified from virtio-blk and nvme code. > > > > As titl

Re: [RFC PATCH 0/2] virtio nvme

2015-09-10 Thread Ming Lin
On Thu, Sep 10, 2015 at 10:02 AM, Ming Lin <m...@kernel.org> wrote: > On Thu, 2015-09-10 at 14:02 +, Keith Busch wrote: >> On Wed, 9 Sep 2015, Ming Lin wrote: >> > The goal is to have a full NVMe stack from VM guest(virtio-nvme) >> > to host(vhost_nvme

Re: [RFC PATCH 0/2] virtio nvme

2015-09-11 Thread Ming Lin
On Fri, 2015-09-11 at 08:48 +0100, Stefan Hajnoczi wrote: > On Thu, Sep 10, 2015 at 6:28 PM, Ming Lin <m...@kernel.org> wrote: > > On Thu, 2015-09-10 at 15:38 +0100, Stefan Hajnoczi wrote: > >> On Thu, Sep 10, 2015 at 6:48 AM, Ming Lin <m...@kernel.org> wrote: >

Re: [RFC PATCH 0/2] virtio nvme

2015-09-11 Thread Ming Lin
On Fri, Sep 11, 2015 at 10:53 AM, Stefan Hajnoczi <stefa...@gmail.com> wrote: > On Fri, Sep 11, 2015 at 6:21 PM, Ming Lin <m...@kernel.org> wrote: >> On Fri, 2015-09-11 at 08:48 +0100, Stefan Hajnoczi wrote: >>> On Thu, Sep 10, 2015 at 6:28 PM, Ming Lin <m...@kern

Re: [RFC PATCH 0/2] virtio nvme

2015-09-17 Thread Ming Lin
On Wed, Sep 16, 2015 at 11:10 PM, Nicholas A. Bellinger <n...@linux-iscsi.org> wrote: > Hi Ming & Co, Hi Nic, > > On Thu, 2015-09-10 at 10:28 -0700, Ming Lin wrote: >> On Thu, 2015-09-10 at 15:38 +0100, Stefan Hajnoczi wrote: >> > On Thu, Sep 10, 2015 at 6:48 AM

Re: [RFC PATCH 0/2] virtio nvme

2015-09-17 Thread Ming Lin
On Wed, 2015-09-16 at 23:10 -0700, Nicholas A. Bellinger wrote: > Hi Ming & Co, > > On Thu, 2015-09-10 at 10:28 -0700, Ming Lin wrote: > > On Thu, 2015-09-10 at 15:38 +0100, Stefan Hajnoczi wrote: > > > On Thu, Sep 10, 2015 at 6:48 AM, Ming Lin <m...@kernel.org&

[RFC PATCH 2/2] virtio-nvme(qemu): NVMe device using virtio

2015-09-09 Thread Ming Lin
Play it with: -drive file=disk.img,format=raw,if=none,id=D22 \ -device virtio-nvme-pci,drive=D22,serial=1234,num_queues=4 Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- hw/block/Makefile.objs | 2 +- hw/block/virtio-nvme.c

[RFC PATCH 0/2] virtio nvme

2015-09-09 Thread Ming Lin
Hi all, These 2 patches added virtio-nvme to kernel and qemu, basically modified from virtio-blk and nvme code. As title said, request for your comments. Play it in Qemu with: -drive file=disk.img,format=raw,if=none,id=D22 \ -device virtio-nvme-pci,drive=D22,serial=1234,num_queues=4 The goal

[RFC PATCH 1/2] virtio_nvme(kernel): virtual NVMe driver using virtio

2015-09-09 Thread Ming Lin
Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/block/Kconfig| 7 + drivers/block/Makefile | 1 + drivers/block/nvme-core.c| 1 + drivers/block/virtio_nvme.c | 853 +++ include/linux/virtio_nvme.h

Re: [RFC PATCH 0/2] virtio nvme

2015-09-27 Thread Ming Lin
On Sat, Sep 26, 2015 at 10:01 PM, Nicholas A. Bellinger wrote: > > Btw, after chatting with Dr. Hannes this week at SDC here are his > original rts-megasas -v6 patches from Feb 2013. > > Note they are standalone patches that require a sufficiently old enough > LIO + QEMU to

Re: [RFC PATCH 0/2] virtio nvme

2015-09-18 Thread Ming Lin
On Fri, Sep 18, 2015 at 2:09 PM, Nicholas A. Bellinger <n...@linux-iscsi.org> wrote: > On Fri, 2015-09-18 at 11:12 -0700, Ming Lin wrote: >> On Thu, 2015-09-17 at 17:55 -0700, Nicholas A. Bellinger wrote: >> > On Thu, 2015-09-17 at 16:31 -0700, Ming Lin wrote: >> &

Re: [RFC PATCH 0/2] virtio nvme

2015-09-18 Thread Ming Lin
On Thu, 2015-09-17 at 17:55 -0700, Nicholas A. Bellinger wrote: > On Thu, 2015-09-17 at 16:31 -0700, Ming Lin wrote: > > On Wed, 2015-09-16 at 23:10 -0700, Nicholas A. Bellinger wrote: > > > Hi Ming & Co, > > > > > > On Thu, 2015-09-10 at 10:28 -0700, Mi

Re: [RFC PATCH 0/2] virtio nvme

2015-09-23 Thread Ming Lin
On Fri, 2015-09-18 at 14:09 -0700, Nicholas A. Bellinger wrote: > On Fri, 2015-09-18 at 11:12 -0700, Ming Lin wrote: > > On Thu, 2015-09-17 at 17:55 -0700, Nicholas A. Bellinger wrote: > > > On Thu, 2015-09-17 at 16:31 -0700, Ming Lin wrote: > > > > On Wed, 2015-

Re: [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-12-01 Thread Ming Lin
On Tue, 2015-12-01 at 11:59 -0500, Paolo Bonzini wrote: > > What do you think about virtio-nvme+vhost-nvme? > > What would be the advantage over virtio-blk? Multiqueue is not supported > by QEMU but it's already supported by Linux (commit 6a27b656fc). I expect performance would be better.

Re: [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-11-25 Thread Ming Lin
On Wed, 2015-11-25 at 12:27 +0100, Paolo Bonzini wrote: > Do you still have a blk_set_aio_context somewhere? I'm losing track of > the changes. No. > > In any case, I think using a separate I/O thread is a bit premature, > except for benchmarking. In the meanwhile I think the best option is

Re: [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-11-24 Thread Ming Lin
On Tue, 2015-11-24 at 11:51 +0100, Paolo Bonzini wrote: > > On 24/11/2015 08:27, Ming Lin wrote: > > handle_notify (qemu/hw/block/dataplane/virtio-blk.c:126) > > aio_dispatch (qemu/aio-posix.c:329) > > aio_poll (qemu/aio-posix.c:474) > > iothread_run (qemu/i

Re: [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-11-30 Thread Ming Lin
On Mon, 2015-11-23 at 15:14 +0100, Paolo Bonzini wrote: > > On 23/11/2015 09:17, Ming Lin wrote: > > On Sat, 2015-11-21 at 14:11 +0100, Paolo Bonzini wrote: > >> > >> On 20/11/2015 01:20, Ming Lin wrote: > >>> One improvment could be to use google

Re: [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-12-01 Thread Ming Lin
On Tue, 2015-12-01 at 17:02 +0100, Paolo Bonzini wrote: > > On 01/12/2015 00:20, Ming Lin wrote: > > qemu-nvme: 148MB/s > > vhost-nvme + google-ext: 230MB/s > > qemu-nvme + google-ext + eventfd: 294MB/s > > virtio-scsi: 296MB/s > > virtio-blk: 344MB/s > >

Re: [PATCH -qemu] nvme: support Google vendor extension

2015-11-20 Thread Ming Lin
On Fri, 2015-11-20 at 09:58 +0100, Paolo Bonzini wrote: > > On 20/11/2015 09:11, Ming Lin wrote: > > On Thu, 2015-11-19 at 11:37 +0100, Paolo Bonzini wrote: > >> > >> On 18/11/2015 06:47, Ming Lin wrote: > >>> @@ -726,7 +798,11 @@ static void nvme_proce

[RFC PATCH 5/9] nvme-vhost: add controller "start" callback

2015-11-19 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/nvme/target/vhost.c | 106 1 file changed, 106 insertions(+) diff --git a/drivers/nvme/target/vhost.c b/drivers/nvme/target/vhost.c i

[RFC PATCH 2/9] nvme-vhost: add basic ioctl handlers

2015-11-19 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/nvme/target/core.c | 1 + drivers/nvme/target/vhost.c | 264 +++- include/uapi/linux/vhost.h | 15 +++ 3 files changed, 279 insertions(+)

[RFC PATCH 3/9] nvme-vhost: add basic nvme bar read/write

2015-11-19 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/nvme/target/vhost.c | 102 include/uapi/linux/vhost.h | 17 ++-- 2 files changed, 116 insertions(+), 3 deletions(-) diff --git a/

[RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-11-19 Thread Ming Lin
Hi, This is the first attempt to add a new qemu nvme backend using in-kernel nvme target. Most code are ported from qemu-nvme and also borrow code from Hannes Reinecke's rts-megasas. It's similar as vhost-scsi, but doesn't use virtio. The advantage is guest can run unmodified NVMe driver. So

[RFC PATCH 1/9] nvme-vhost: add initial commit

2015-11-19 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/nvme/target/Kconfig | 11 +++ drivers/nvme/target/Makefile | 2 ++ drivers/nvme/target/vhost.c | 16 3 files changed, 29 insertions(+) create mode 100644

[RFC PATCH 4/9] nvmet: add a controller "start" hook

2015-11-19 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> This is used to execute controller specific start code Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/nvme/target/core.c | 3 +++ drivers/nvme/target/nvmet.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/nvme/t

[RFC PATCH 6/9] nvmet: add a "parse_extra_admin_cmd" hook

2015-11-19 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> This is used to execute controller specific cmd parse code Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/nvme/target/admin-cmd.c | 7 +++ drivers/nvme/target/nvmet.h | 3 +++ 2 files changed, 10 insertions(+) diff --g

[RFC PATCH 8/9] nvme-vhost: add vhost memory helpers

2015-11-19 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> This borrows code from Hannes Reinecke's rts-megasas. Cc: Hannes Reinecke <h...@suse.de> Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/nvme/target/vhost.c | 108 1 file chang

[RFC PATCH 7/9] nvme-vhost: add "parse_extra_admin_cmd" callback

2015-11-19 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/nvme/target/vhost.c | 153 1 file changed, 153 insertions(+) diff --git a/drivers/nvme/target/vhost.c b/drivers/nvme/target/vhost.c i

[RFC PATCH 9/9] nvme-vhost: add nvme queue handlers

2015-11-19 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> This adds nvme submission/completion queue handlers, which are ported from qemu-nvme. And hooks into nvme-target to do the real job. Cc: Keith Busch <keith.bu...@intel.com> Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/n

Re: [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-11-19 Thread Ming Lin
now why it's lost. mlin@ssi:~$ history |grep "nab" 1861 git send-email --from "Ming Lin <m...@kernel.org>" --to "linux-n...@lists.infradead.org" --cc "qemu-de...@nongnu.org" --cc "virtualization@lists.linux-foundation.org" --cc "

Re: [RFC PATCH 4/9] nvmet: add a controller "start" hook

2015-11-19 Thread Ming Lin
On Fri, 2015-11-20 at 06:13 +0100, Christoph Hellwig wrote: > On Thu, Nov 19, 2015 at 04:21:03PM -0800, Ming Lin wrote: > > #define NVMET_SUBSYS_NAME_LEN 256 > > charsubsys_name[NVMET_SUBSYS_NAME_LEN]; > > + > > + void

Re: [PATCH -qemu] nvme: support Google vendor extension

2015-11-20 Thread Ming Lin
On Thu, 2015-11-19 at 11:37 +0100, Paolo Bonzini wrote: > > On 18/11/2015 06:47, Ming Lin wrote: > > @@ -726,7 +798,11 @@ static void nvme_process_db(NvmeCtrl *n, hwaddr addr, > > int val) > > } > > > > start_sqs = nvme_cq_full(cq) ? 1 :

Re: [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-11-23 Thread Ming Lin
On Sat, 2015-11-21 at 14:11 +0100, Paolo Bonzini wrote: > > On 20/11/2015 01:20, Ming Lin wrote: > > One improvment could be to use google's NVMe vendor extension that > > I send in another thread, aslo here: > > https://git.kernel.org/cgit/linux/kernel/git/mlin/linux.gi

Re: [PATCH -qemu] nvme: support Google vendor extension

2015-11-21 Thread Ming Lin
On Sat, 2015-11-21 at 13:56 +0100, Paolo Bonzini wrote: > > On 21/11/2015 00:05, Ming Lin wrote: > > [1.752129] Freeing unused kernel memory: 420K (880001b97000 - > > 880001c0) > > [1.986573] clocksource: tsc: mask: 0x max_cy

Re: [PATCH -qemu] nvme: support Google vendor extension

2015-11-23 Thread Ming Lin
On Sat, 2015-11-21 at 23:45 -0800, Ming Lin wrote: > On Sat, 2015-11-21 at 13:56 +0100, Paolo Bonzini wrote: > > > > On 21/11/2015 00:05, Ming Lin wrote: > > > [1.752129] Freeing unused kernel memory: 420K (880001b97000 - > > > 880001c0) >

Re: [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-11-23 Thread Ming Lin
On Mon, 2015-11-23 at 15:14 +0100, Paolo Bonzini wrote: > > On 23/11/2015 09:17, Ming Lin wrote: > > On Sat, 2015-11-21 at 14:11 +0100, Paolo Bonzini wrote: > >> > >> On 20/11/2015 01:20, Ming Lin wrote: > >>> One improvment could be to use google

Re: [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-11-24 Thread Ming Lin
On Mon, 2015-11-23 at 23:27 -0800, Ming Lin wrote: > On Mon, 2015-11-23 at 15:14 +0100, Paolo Bonzini wrote: > > > > On 23/11/2015 09:17, Ming Lin wrote: > > > On Sat, 2015-11-21 at 14:11 +0100, Paolo Bonzini wrote: > > >> > > >> On 20/11/2015 01: