search for: balloon_page_chunk

Displaying 20 results from an estimated 39 matches for "balloon_page_chunk".

2017 Jun 09
0
[PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...efine VIRTIO_BALLOON_PAGE_BMAP_MAX_NUM 32 + +/* + * QEMU virtio implementation requires the desc table size less than + * VIRTQUEUE_MAX_SIZE, so minus 1 here. + */ +#define VIRTIO_BALLOON_MAX_PAGE_CHUNKS (VIRTQUEUE_MAX_SIZE - 1) + +/* The struct to manage ballooned pages in chunks */ +struct virtio_balloon_page_chunk { + /* Indirect desc table to hold chunks of balloon pages */ + struct vring_desc *desc_table; + /* Number of added chunks of balloon pages */ + unsigned int chunk_num; + /* Bitmap used to record ballooned pages. */ + unsigned long *page_bmap[VIRTIO_BALLOON_PAGE_BMAP_MAX_NUM]; +}; + struct virtio_...
2017 Jun 09
11
[PATCH v11 0/6] Virtio-balloon Enhancement
This patch series enhances the existing virtio-balloon with the following new features: 1) fast ballooning: transfer ballooned pages between the guest and host in chunks, instead of one by one; and 2) cmdq: a new virtqueue to send commands between the device and driver. Currently, it supports commands to report memory stats (replace the old statq mechanism) and report guest unused pages. Liang Li
2017 Jun 09
11
[PATCH v11 0/6] Virtio-balloon Enhancement
This patch series enhances the existing virtio-balloon with the following new features: 1) fast ballooning: transfer ballooned pages between the guest and host in chunks, instead of one by one; and 2) cmdq: a new virtqueue to send commands between the device and driver. Currently, it supports commands to report memory stats (replace the old statq mechanism) and report guest unused pages. Liang Li
2017 Jun 13
5
[PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...MAX_PAGE_CHUNKS (VIRTQUEUE_MAX_SIZE - 1) This is wrong, virtio spec says s/g size should not exceed VQ size. If you want to support huge VQ sizes, you can add a fallback to smaller sizes until it fits in 1 page. > + > +/* The struct to manage ballooned pages in chunks */ > +struct virtio_balloon_page_chunk { > + /* Indirect desc table to hold chunks of balloon pages */ > + struct vring_desc *desc_table; > + /* Number of added chunks of balloon pages */ > + unsigned int chunk_num; > + /* Bitmap used to record ballooned pages. */ > + unsigned long *page_bmap[VIRTIO_BALLOON_PAGE_BMAP_M...
2017 Jun 13
5
[PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...MAX_PAGE_CHUNKS (VIRTQUEUE_MAX_SIZE - 1) This is wrong, virtio spec says s/g size should not exceed VQ size. If you want to support huge VQ sizes, you can add a fallback to smaller sizes until it fits in 1 page. > + > +/* The struct to manage ballooned pages in chunks */ > +struct virtio_balloon_page_chunk { > + /* Indirect desc table to hold chunks of balloon pages */ > + struct vring_desc *desc_table; > + /* Number of added chunks of balloon pages */ > + unsigned int chunk_num; > + /* Bitmap used to record ballooned pages. */ > + unsigned long *page_bmap[VIRTIO_BALLOON_PAGE_BMAP_M...
2017 Jun 09
0
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...efine PAGE_CHUNK_TYPE_BALLOON 0 /* Chunk of inflate/deflate pages */ +#define PAGE_CHNUK_UNUSED_PAGE 1 /* Chunk of unused pages */ + /* The size of one page_bmap used to record inflated/deflated pages. */ #define VIRTIO_BALLOON_PAGE_BMAP_SIZE (8 * PAGE_SIZE) /* @@ -81,12 +85,25 @@ struct virtio_balloon_page_chunk { unsigned long *page_bmap[VIRTIO_BALLOON_PAGE_BMAP_MAX_NUM]; }; +struct virtio_balloon_cmdq_unused_page { + struct virtio_balloon_cmdq_hdr hdr; + struct vring_desc *desc_table; + /* Number of added descriptors */ + unsigned int num; +}; + +struct virtio_balloon_cmdq_stats { + struct virtio_ba...
2017 May 04
0
[PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...C(oom_pages, "pages to free on OOM"); @@ -51,6 +65,11 @@ MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); static struct vfsmount *balloon_mnt; #endif +/* Maximum number of page chunks */ +#define VIRTIO_BALLOON_MAX_PAGE_CHUNKS ((8 * PAGE_SIZE - \ + sizeof(struct virtio_balloon_page_chunk)) / \ + sizeof(struct virtio_balloon_page_chunk_entry)) + struct virtio_balloon { struct virtio_device *vdev; struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; @@ -79,6 +98,12 @@ struct virtio_balloon { /* Synchronize access/update to this struct virtio_balloon elements */ struct mut...
2017 May 04
8
[PATCH v10 0/6] Extend virtio-balloon for fast (de)inflating & fast live migration
This patch series implements the follow two things: 1) Optimization of balloon page transfer: instead of transferring balloon pages to host one by one, the new mechanism transfers them in chunks. 2) A mechanism to report info of guest unused pages: the pages have been unused at some time between when host sent command and when guest reported them. Host uses that by tracking memory changes and
2017 May 04
8
[PATCH v10 0/6] Extend virtio-balloon for fast (de)inflating & fast live migration
This patch series implements the follow two things: 1) Optimization of balloon page transfer: instead of transferring balloon pages to host one by one, the new mechanism transfers them in chunks. 2) A mechanism to report info of guest unused pages: the pages have been unused at some time between when host sent command and when guest reported them. Host uses that by tracking memory changes and
2017 May 05
1
[PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...OOM"); > @@ -51,6 +65,11 @@ MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); > static struct vfsmount *balloon_mnt; > #endif > > +/* Maximum number of page chunks */ > +#define VIRTIO_BALLOON_MAX_PAGE_CHUNKS ((8 * PAGE_SIZE - \ > + sizeof(struct virtio_balloon_page_chunk)) / \ > + sizeof(struct virtio_balloon_page_chunk_entry)) > + > struct virtio_balloon { > struct virtio_device *vdev; > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; > @@ -79,6 +98,12 @@ struct virtio_balloon { > /* Synchronize access/update to this struct virt...
2017 May 05
1
[PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...OOM"); > @@ -51,6 +65,11 @@ MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); > static struct vfsmount *balloon_mnt; > #endif > > +/* Maximum number of page chunks */ > +#define VIRTIO_BALLOON_MAX_PAGE_CHUNKS ((8 * PAGE_SIZE - \ > + sizeof(struct virtio_balloon_page_chunk)) / \ > + sizeof(struct virtio_balloon_page_chunk_entry)) > + > struct virtio_balloon { > struct virtio_device *vdev; > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; > @@ -79,6 +98,12 @@ struct virtio_balloon { > /* Synchronize access/update to this struct virt...
2017 Jun 20
2
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
On Fri, Jun 09, 2017 at 06:41:41PM +0800, Wei Wang wrote: > - if (!virtqueue_indirect_desc_table_add(vq, desc, num)) { > + if (!virtqueue_indirect_desc_table_add(vq, desc, *num)) { > virtqueue_kick(vq); > - wait_event(vb->acked, virtqueue_get_buf(vq, &len)); > - vb->balloon_page_chunk.chunk_num = 0; > + if (busy_wait) > + while (!virtqueue_get_buf(vq, &len) && > + !virtqueue_is_broken(vq)) > + cpu_relax(); > + else > + wait_event(vb->acked, virtqueue_get_buf(vq, &len)); This is something I didn't previously notice. As...
2017 Jun 20
2
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
On Fri, Jun 09, 2017 at 06:41:41PM +0800, Wei Wang wrote: > - if (!virtqueue_indirect_desc_table_add(vq, desc, num)) { > + if (!virtqueue_indirect_desc_table_add(vq, desc, *num)) { > virtqueue_kick(vq); > - wait_event(vb->acked, virtqueue_get_buf(vq, &len)); > - vb->balloon_page_chunk.chunk_num = 0; > + if (busy_wait) > + while (!virtqueue_get_buf(vq, &len) && > + !virtqueue_is_broken(vq)) > + cpu_relax(); > + else > + wait_event(vb->acked, virtqueue_get_buf(vq, &len)); This is something I didn't previously notice. As...
2017 Jun 15
0
[virtio-dev] Re: [PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...t also references VIRTIO_BALLOON_PAGE_BMAP_DEFAULT_NUM (not assuming any number) > +} > + > +/* Add a chunk to the buffer. */ > +static void add_one_chunk(struct virtio_balloon *vb, struct virtqueue *vq, > + u64 base_addr, u32 size) > +{ > + unsigned int *num = &vb->balloon_page_chunk.chunk_num; > + struct vring_desc *desc = &vb->balloon_page_chunk.desc_table[*num]; > + > + desc->addr = cpu_to_virtio64(vb->vdev, base_addr); > + desc->len = cpu_to_virtio32(vb->vdev, size); > + *num += 1; > + if (*num == VIRTIO_BALLOON_MAX_PAGE_CHUNKS) > +...
2017 Mar 16
0
[PATCH kernel v8 2/4] virtio-balloon: VIRTIO_BALLOON_F_CHUNK_TRANSFER
...nt, S_IRUSR | S_IWUSR); MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); @@ -50,6 +54,14 @@ MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); static struct vfsmount *balloon_mnt; #endif +#define BALLOON_CHUNK_BASE_SHIFT 12 +#define BALLOON_CHUNK_SIZE_SHIFT 12 +struct balloon_page_chunk { + __le64 base; + __le64 size; +}; + +typedef __le64 resp_data_t; struct virtio_balloon { struct virtio_device *vdev; struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; @@ -67,6 +79,31 @@ struct virtio_balloon { /* Number of balloon pages we've told the Host we're not using. */...
2017 Apr 05
2
[PATCH kernel v8 2/4] virtio-balloon: VIRTIO_BALLOON_F_CHUNK_TRANSFER
...LE_PARM_DESC(oom_pages, "pages to free on OOM"); @@ -50,6 +54,14 > @@ MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); static struct > vfsmount *balloon_mnt; #endif > > +#define BALLOON_CHUNK_BASE_SHIFT 12 > +#define BALLOON_CHUNK_SIZE_SHIFT 12 > +struct balloon_page_chunk { > + __le64 base; > + __le64 size; > +}; > + > +typedef __le64 resp_data_t; > struct virtio_balloon { > struct virtio_device *vdev; > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; @@ -67,6 +79,31 > @@ struct virtio_balloon { > > /* Number of balloon...
2017 Apr 05
2
[PATCH kernel v8 2/4] virtio-balloon: VIRTIO_BALLOON_F_CHUNK_TRANSFER
...LE_PARM_DESC(oom_pages, "pages to free on OOM"); @@ -50,6 +54,14 > @@ MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); static struct > vfsmount *balloon_mnt; #endif > > +#define BALLOON_CHUNK_BASE_SHIFT 12 > +#define BALLOON_CHUNK_SIZE_SHIFT 12 > +struct balloon_page_chunk { > + __le64 base; > + __le64 size; > +}; > + > +typedef __le64 resp_data_t; > struct virtio_balloon { > struct virtio_device *vdev; > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; @@ -67,6 +79,31 > @@ struct virtio_balloon { > > /* Number of balloon...
2017 Mar 10
0
[virtio-dev] Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER
...ram(oom_pages, int, S_IRUSR | S_IWUSR); >> MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); >> @@ -50,6 +54,16 @@ MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); >> static struct vfsmount *balloon_mnt; >> #endif >> >> +struct balloon_page_chunk { >> + __le64 base : 52; >> + __le64 size : 12; >> +}; >> + >> +struct balloon_page_chunk_ext { >> + __le64 base; >> + __le64 size; >> +}; >> + >> struct virtio_balloon { >> struct virtio_device *vdev; >> struct virtque...
2017 Mar 08
3
[PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER
...FAULT_PAGES; > module_param(oom_pages, int, S_IRUSR | S_IWUSR); > MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); > @@ -50,6 +54,16 @@ MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); > static struct vfsmount *balloon_mnt; > #endif > > +struct balloon_page_chunk { > + __le64 base : 52; > + __le64 size : 12; > +}; > + > +struct balloon_page_chunk_ext { > + __le64 base; > + __le64 size; > +}; > + > struct virtio_balloon { > struct virtio_device *vdev; > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; > @@ -67...
2017 Mar 08
3
[PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER
...FAULT_PAGES; > module_param(oom_pages, int, S_IRUSR | S_IWUSR); > MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); > @@ -50,6 +54,16 @@ MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); > static struct vfsmount *balloon_mnt; > #endif > > +struct balloon_page_chunk { > + __le64 base : 52; > + __le64 size : 12; > +}; > + > +struct balloon_page_chunk_ext { > + __le64 base; > + __le64 size; > +}; > + > struct virtio_balloon { > struct virtio_device *vdev; > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; > @@ -67...