All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: Andrea Arcangeli <aarcange@redhat.com>,
	Nadav Har'El <nyh@math.technion.ac.il>,
	kvm@vger.kernel.org, satoshi.itoh@aist.go.jp,
	Stefan Hajnoczi <stefanha@gmail.com>,
	t.hirofuchi@aist.go.jp, Dor Laor <dlaor@redhat.com>,
	qemu-devel@nongnu.org, Yaniv Kaul <ykaul@redhat.com>
Subject: Re: [PATCH][RFC] post copy chardevice (was Re: [RFC] postcopy livemigration proposal)
Date: Mon, 15 Aug 2011 12:29:37 -0700	[thread overview]
Message-ID: <4E4973A1.2040008@redhat.com> (raw)
In-Reply-To: <20110812110737.GA13791@valinux.co.jp>

On 08/12/2011 04:07 AM, Isaku Yamahata wrote:
> This is a character device to hook page access.
> The page fault in the area is reported to another user process by
> this chardriver. Then, the process fills the page contents and
> resolves the page fault.

Have you considered CUSE (character device in userspace, fs/fuse/cuse.c)?

> index 55f5afb..623109e 100644
> --- a/include/linux/kvm.h
> +++ b/include/linux/kvm.h
> @@ -554,6 +554,7 @@ struct kvm_ppc_pvinfo {
>   #define KVM_CAP_PPC_SMT 64
>   #define KVM_CAP_PPC_RMA	65
>   #define KVM_CAP_MAX_VCPUS 66       /* returns max vcpus per vm */
> +#define KVM_CAP_POST_COPY_MEMORY 67
>
>   #ifdef KVM_CAP_IRQ_ROUTING
>
> @@ -760,6 +761,50 @@ struct kvm_clock_data {
>   /* Available with KVM_CAP_RMA */
>   #define KVM_ALLOCATE_RMA	  _IOR(KVMIO,  0xa9, struct kvm_allocate_rma)
>
> +struct kvm_vmem_create {
> +	__u64 size;	/* in bytes */
> +	__s32 vmem_fd;
> +	__s32 shmem_fd;
> +};

Should really be outside kvm.h (and virt/kvm), since it's not kvm specific.

> +
> +struct kvm_vmem_page_request {
> +	__u32 nr;
> +	__u64 __user *pgoffs;
> +};
> +
> +struct kvm_vmem_page_cached {
> +	__u32 nr;
> +	__u64 __user *pgoffs;
> +};
> +
> +struct kvm_vmem_page_range {
> +	__u64 pgoff;
> +	__u64 nr_pages;
> +};
> +
> +struct kvm_vmem_make_pages_present {
> +	__u32 nr;
> +	struct kvm_vmem_page_range __user *ranges;
> +};

This is madvise(MADV_WILLNEED), is it not?

> +
> +/* Available with KVM_CAP_POST_COPY_MEMORY */
> +#define KVM_CREATE_VMEM_DEV       _IO(KVMIO,  0xb0)
> +
> +/* ioctl for vmem_dev fd */
> +#define KVM_CREATE_VMEM		  _IOR(KVMIO, 0xb1, __u32)
> +
> +/* ioctl for vmem fd */
> +#define KVM_VMEM_WAIT_READY	  _IO(KVMIO,  0xb2)
> +#define KVM_VMEM_READY		  _IO(KVMIO,  0xb3)
> +#define KVM_VMEM_GET_PAGE_REQUEST \
> +	_IOWR(KVMIO, 0xb4, struct kvm_vmem_page_request)
> +#define KVM_VMEM_MARK_PAGE_CACHED \
> +	_IOW(KVMIO,  0xb5, struct kvm_vmem_page_cached)
> +#define KVM_VMEM_MAKE_PAGES_PRESENT \
> +	_IOW(KVMIO,  0xb6, struct kvm_vmem_make_pages_present)
> +#define KVM_VMEM_MAKE_VMA_ANONYMOUS _IO(KVMIO, 0xb7)

Can you explain these in some more detail?

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: Andrea Arcangeli <aarcange@redhat.com>,
	Nadav Har'El <nyh@math.technion.ac.il>,
	kvm@vger.kernel.org, satoshi.itoh@aist.go.jp,
	Stefan Hajnoczi <stefanha@gmail.com>,
	t.hirofuchi@aist.go.jp, Dor Laor <dlaor@redhat.com>,
	qemu-devel@nongnu.org, Yaniv Kaul <ykaul@redhat.com>
Subject: Re: [Qemu-devel] [PATCH][RFC] post copy chardevice (was Re: [RFC] postcopy livemigration proposal)
Date: Mon, 15 Aug 2011 12:29:37 -0700	[thread overview]
Message-ID: <4E4973A1.2040008@redhat.com> (raw)
In-Reply-To: <20110812110737.GA13791@valinux.co.jp>

On 08/12/2011 04:07 AM, Isaku Yamahata wrote:
> This is a character device to hook page access.
> The page fault in the area is reported to another user process by
> this chardriver. Then, the process fills the page contents and
> resolves the page fault.

Have you considered CUSE (character device in userspace, fs/fuse/cuse.c)?

> index 55f5afb..623109e 100644
> --- a/include/linux/kvm.h
> +++ b/include/linux/kvm.h
> @@ -554,6 +554,7 @@ struct kvm_ppc_pvinfo {
>   #define KVM_CAP_PPC_SMT 64
>   #define KVM_CAP_PPC_RMA	65
>   #define KVM_CAP_MAX_VCPUS 66       /* returns max vcpus per vm */
> +#define KVM_CAP_POST_COPY_MEMORY 67
>
>   #ifdef KVM_CAP_IRQ_ROUTING
>
> @@ -760,6 +761,50 @@ struct kvm_clock_data {
>   /* Available with KVM_CAP_RMA */
>   #define KVM_ALLOCATE_RMA	  _IOR(KVMIO,  0xa9, struct kvm_allocate_rma)
>
> +struct kvm_vmem_create {
> +	__u64 size;	/* in bytes */
> +	__s32 vmem_fd;
> +	__s32 shmem_fd;
> +};

Should really be outside kvm.h (and virt/kvm), since it's not kvm specific.

> +
> +struct kvm_vmem_page_request {
> +	__u32 nr;
> +	__u64 __user *pgoffs;
> +};
> +
> +struct kvm_vmem_page_cached {
> +	__u32 nr;
> +	__u64 __user *pgoffs;
> +};
> +
> +struct kvm_vmem_page_range {
> +	__u64 pgoff;
> +	__u64 nr_pages;
> +};
> +
> +struct kvm_vmem_make_pages_present {
> +	__u32 nr;
> +	struct kvm_vmem_page_range __user *ranges;
> +};

This is madvise(MADV_WILLNEED), is it not?

> +
> +/* Available with KVM_CAP_POST_COPY_MEMORY */
> +#define KVM_CREATE_VMEM_DEV       _IO(KVMIO,  0xb0)
> +
> +/* ioctl for vmem_dev fd */
> +#define KVM_CREATE_VMEM		  _IOR(KVMIO, 0xb1, __u32)
> +
> +/* ioctl for vmem fd */
> +#define KVM_VMEM_WAIT_READY	  _IO(KVMIO,  0xb2)
> +#define KVM_VMEM_READY		  _IO(KVMIO,  0xb3)
> +#define KVM_VMEM_GET_PAGE_REQUEST \
> +	_IOWR(KVMIO, 0xb4, struct kvm_vmem_page_request)
> +#define KVM_VMEM_MARK_PAGE_CACHED \
> +	_IOW(KVMIO,  0xb5, struct kvm_vmem_page_cached)
> +#define KVM_VMEM_MAKE_PAGES_PRESENT \
> +	_IOW(KVMIO,  0xb6, struct kvm_vmem_make_pages_present)
> +#define KVM_VMEM_MAKE_VMA_ANONYMOUS _IO(KVMIO, 0xb7)

Can you explain these in some more detail?

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

  parent reply	other threads:[~2011-08-15 19:29 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08  3:24 [RFC] postcopy livemigration proposal Isaku Yamahata
2011-08-08  3:24 ` [Qemu-devel] " Isaku Yamahata
2011-08-08  9:20 ` Dor Laor
2011-08-08  9:20   ` [Qemu-devel] " Dor Laor
2011-08-08  9:40   ` Yaniv Kaul
2011-08-08  9:40     ` [Qemu-devel] " Yaniv Kaul
2011-08-08 21:42     ` Anthony Liguori
2011-08-08 21:42       ` Anthony Liguori
2011-08-08 10:59   ` Nadav Har'El
2011-08-08 10:59     ` [Qemu-devel] " Nadav Har'El
2011-08-08 11:47     ` Dor Laor
2011-08-08 11:47       ` [Qemu-devel] " Dor Laor
2011-08-08 16:52       ` Cleber Rosa
2011-08-08 15:52         ` Anthony Liguori
2011-08-08 12:32   ` Anthony Liguori
2011-08-08 12:32     ` [Qemu-devel] " Anthony Liguori
2011-08-08 15:11     ` Dor Laor
2011-08-08 15:11       ` Dor Laor
2011-08-08 15:29       ` Anthony Liguori
2011-08-08 15:29         ` Anthony Liguori
2011-08-08 15:36         ` Avi Kivity
2011-08-08 15:36           ` [Qemu-devel] " Avi Kivity
2011-08-08 15:59           ` Anthony Liguori
2011-08-08 15:59             ` Anthony Liguori
2011-08-08 19:47             ` Dor Laor
2011-08-08 19:47               ` [Qemu-devel] " Dor Laor
2011-08-09  2:07               ` Isaku Yamahata
2011-08-09  2:07                 ` Isaku Yamahata
2011-08-08  9:38 ` Stefan Hajnoczi
2011-08-08  9:38   ` Stefan Hajnoczi
2011-08-08  9:43   ` Isaku Yamahata
2011-08-08  9:43     ` Isaku Yamahata
2011-08-08 12:38 ` Avi Kivity
2011-08-08 12:38   ` [Qemu-devel] " Avi Kivity
2011-08-09  2:33   ` Isaku Yamahata
2011-08-09  2:33     ` [Qemu-devel] " Isaku Yamahata
2011-08-10 13:55     ` Avi Kivity
2011-08-10 13:55       ` [Qemu-devel] " Avi Kivity
2011-08-11  2:19       ` Isaku Yamahata
2011-08-11  2:19         ` [Qemu-devel] " Isaku Yamahata
2011-08-11 16:55         ` Andrea Arcangeli
2011-08-11 16:55           ` [Qemu-devel] " Andrea Arcangeli
2011-08-12 11:07 ` [PATCH][RFC] post copy chardevice (was Re: [RFC] postcopy livemigration proposal) Isaku Yamahata
2011-08-12 11:07   ` [Qemu-devel] " Isaku Yamahata
2011-08-12 11:09   ` Isaku Yamahata
2011-08-12 11:09     ` [Qemu-devel] " Isaku Yamahata
2011-08-12 21:26   ` Blue Swirl
2011-08-12 21:26     ` Blue Swirl
2011-08-15 19:29   ` Avi Kivity [this message]
2011-08-15 19:29     ` Avi Kivity
2011-08-16  1:42     ` Isaku Yamahata
2011-08-16  1:42       ` [Qemu-devel] " Isaku Yamahata
2011-08-16 13:40       ` Avi Kivity
2011-08-16 13:40         ` [Qemu-devel] " Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E4973A1.2040008@redhat.com \
    --to=avi@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=dlaor@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=nyh@math.technion.ac.il \
    --cc=qemu-devel@nongnu.org \
    --cc=satoshi.itoh@aist.go.jp \
    --cc=stefanha@gmail.com \
    --cc=t.hirofuchi@aist.go.jp \
    --cc=yamahata@valinux.co.jp \
    --cc=ykaul@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.