search for: chunk_num

Displaying 20 results from an estimated 20 matches for "chunk_num".

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 07
2
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...; If size < 4g is not a significant limitation, why not just use that to pass > address/size in a standard s/g list, possibly using INDIRECT? OK, I see your point, thanks. Post the two options here for an analysis: Option1 (what we have now): struct virtio_balloon_page_chunk { __le64 chunk_num; struct virtio_balloon_page_chunk_entry entry[]; }; Option2: struct virtio_balloon_page_chunk { __le64 chunk_num; struct scatterlist entry[]; }; I don't have an issue to change it to Option2, but I would prefer Option1, because I think there is no be obvious difference...
2017 May 07
2
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...; If size < 4g is not a significant limitation, why not just use that to pass > address/size in a standard s/g list, possibly using INDIRECT? OK, I see your point, thanks. Post the two options here for an analysis: Option1 (what we have now): struct virtio_balloon_page_chunk { __le64 chunk_num; struct virtio_balloon_page_chunk_entry entry[]; }; Option2: struct virtio_balloon_page_chunk { __le64 chunk_num; struct scatterlist entry[]; }; I don't have an issue to change it to Option2, but I would prefer Option1, because I think there is no be obvious difference...
2017 May 04
0
[PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...IRTIO_BALLOON_PAGE_BMAP_SIZE); +} + +static void send_page_chunks(struct virtio_balloon *vb, struct virtqueue *vq) +{ + struct scatterlist sg; + struct virtio_balloon_page_chunk *chunk; + unsigned int len; + + chunk = vb->balloon_page_chunk; + len = sizeof(__le64) + + le64_to_cpu(chunk->chunk_num) * + sizeof(struct virtio_balloon_page_chunk_entry); + sg_init_one(&sg, chunk, len); + if (!virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL)) { + virtqueue_kick(vq); + wait_event(vb->acked, virtqueue_get_buf(vq, &len)); + chunk->chunk_num = 0; + } +} + +/* Add a chunk ent...
2017 May 05
1
[PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...tic void send_page_chunks(struct virtio_balloon *vb, struct virtqueue *vq) > +{ > + struct scatterlist sg; > + struct virtio_balloon_page_chunk *chunk; > + unsigned int len; > + > + chunk = vb->balloon_page_chunk; > + len = sizeof(__le64) + > + le64_to_cpu(chunk->chunk_num) * > + sizeof(struct virtio_balloon_page_chunk_entry); > + sg_init_one(&sg, chunk, len); > + if (!virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL)) { > + virtqueue_kick(vq); > + wait_event(vb->acked, virtqueue_get_buf(vq, &len)); > + chunk->chunk_num = 0...
2017 May 05
1
[PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...tic void send_page_chunks(struct virtio_balloon *vb, struct virtqueue *vq) > +{ > + struct scatterlist sg; > + struct virtio_balloon_page_chunk *chunk; > + unsigned int len; > + > + chunk = vb->balloon_page_chunk; > + len = sizeof(__le64) + > + le64_to_cpu(chunk->chunk_num) * > + sizeof(struct virtio_balloon_page_chunk_entry); > + sg_init_one(&sg, chunk, len); > + if (!virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL)) { > + virtqueue_kick(vq); > + wait_event(vb->acked, virtqueue_get_buf(vq, &len)); > + chunk->chunk_num = 0...
2017 Jun 09
0
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...) { - unsigned int len, num; - struct vring_desc *desc = vb->balloon_page_chunk.desc_table; + unsigned int len, *num, reset_num; + struct vring_desc *desc; + + switch (type) { + case PAGE_CHUNK_TYPE_BALLOON: + desc = vb->balloon_page_chunk.desc_table; + num = &vb->balloon_page_chunk.chunk_num; + reset_num = 0; + break; + case PAGE_CHNUK_UNUSED_PAGE: + desc = vb->cmdq_unused_page.desc_table; + num = &vb->cmdq_unused_page.num; + /* + * The first desc is used for the cmdq_hdr, so chunks will be + * added from the second desc. + */ + reset_num = 1; + break; + default:...
2017 Jun 20
2
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...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 you always...
2017 Jun 20
2
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...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 you always...
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 May 08
0
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...nificant limitation, why not just use that to pass > > address/size in a standard s/g list, possibly using INDIRECT? > > OK, I see your point, thanks. Post the two options here for an analysis: > Option1 (what we have now): > struct virtio_balloon_page_chunk { > __le64 chunk_num; > struct virtio_balloon_page_chunk_entry entry[]; > }; > Option2: > struct virtio_balloon_page_chunk { > __le64 chunk_num; > struct scatterlist entry[]; > }; This isn't what I meant really :) I meant vring_desc. > I don't have an issue to c...
2017 Jun 09
0
[PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...IO_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_balloon { struct virtio_device *vdev; struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; @@ -79,6 +109,8 @@ struct virtio_balloon { /* Synchronize access/updat...
2017 Apr 27
2
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
On 04/27/2017 07:20 AM, Michael S. Tsirkin wrote: > On Wed, Apr 26, 2017 at 11:03:34AM +0000, Wang, Wei W wrote: >> Hi Michael, could you please give some feedback? > I'm sorry, I'm not sure feedback on what you are requesting. Oh, just some trivial things (e.g. use a field in the header, hdr->chunks to indicate the number of chunks in the payload) that wasn't confirmed.
2017 Apr 27
2
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
On 04/27/2017 07:20 AM, Michael S. Tsirkin wrote: > On Wed, Apr 26, 2017 at 11:03:34AM +0000, Wang, Wei W wrote: >> Hi Michael, could you please give some feedback? > I'm sorry, I'm not sure feedback on what you are requesting. Oh, just some trivial things (e.g. use a field in the header, hdr->chunks to indicate the number of chunks in the payload) that wasn't confirmed.
2017 Jun 13
5
[PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...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_MAX_NUM]; > +}; > + > struct virtio_balloon { > struct virtio_device *vdev; > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; > @@ -79,6 +109,8 @@ struct virtio...
2017 Jun 13
5
[PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...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_MAX_NUM]; > +}; > + > struct virtio_balloon { > struct virtio_device *vdev; > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; > @@ -79,6 +109,8 @@ struct virtio...
2017 Jul 12
0
[virtio-dev] Re: [PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
..._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...
2017 Jun 15
0
[virtio-dev] Re: [PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...IRTIO_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) > + send_page_...