search for: add_one_chunk

Displaying 20 results from an estimated 36 matches for "add_one_chunk".

2017 Jun 09
0
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...&len)); + /* + * Now, the descriptor have been delivered to the host. Reset + * the field in the structure that records the number of added + * descriptors, so that new added descriptor can be re-counted. + */ + *num = reset_num; } } /* Add a chunk to the buffer. */ static void add_one_chunk(struct virtio_balloon *vb, struct virtqueue *vq, - u64 base_addr, u32 size) + int type, 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]; + unsigned int *num; + struct vrin...
2017 Apr 14
2
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...; hdr->chunks tells the host how many chunks are there in the payload. > After the device use it, it is ready to zero it. It's rather confusing. Try to pass # of chunks around in some other way. > > > > > + } > > > +} > > > + > > > +static void add_one_chunk(struct virtio_balloon *vb, struct virtqueue *vq, > > > + int type, u64 base, u64 size) > > what are the units here? Looks like it's in 4kbyte units? > > what is the "unit" you referred to? > This is the function to add one chunk, base pfn and size of the c...
2017 Apr 14
2
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...; hdr->chunks tells the host how many chunks are there in the payload. > After the device use it, it is ready to zero it. It's rather confusing. Try to pass # of chunks around in some other way. > > > > > + } > > > +} > > > + > > > +static void add_one_chunk(struct virtio_balloon *vb, struct virtqueue *vq, > > > + int type, u64 base, u64 size) > > what are the units here? Looks like it's in 4kbyte units? > > what is the "unit" you referred to? > This is the function to add one chunk, base pfn and size of the c...
2017 Jun 12
1
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...er > 0; order--) { > + for (migratetype = 0; migratetype < MIGRATE_TYPES; > + migratetype++) { > + do { > + ret = report_unused_page_block(zone, > + order, migratetype, &page); > + if (!ret) { > + pfn = (u64)page_to_pfn(page); > + add_one_chunk(vb, vq, > + PAGE_CHNUK_UNUSED_PAGE, > + pfn << VIRTIO_BALLOON_PFN_SHIFT, > + (u64)(1 << order) * > + VIRTIO_BALLOON_PAGES_PER_PAGE); > + } > + } while (!ret); > + } > + } > + } This is pretty unreadable. Please add some indent...
2017 Jun 12
1
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...er > 0; order--) { > + for (migratetype = 0; migratetype < MIGRATE_TYPES; > + migratetype++) { > + do { > + ret = report_unused_page_block(zone, > + order, migratetype, &page); > + if (!ret) { > + pfn = (u64)page_to_pfn(page); > + add_one_chunk(vb, vq, > + PAGE_CHNUK_UNUSED_PAGE, > + pfn << VIRTIO_BALLOON_PFN_SHIFT, > + (u64)(1 << order) * > + VIRTIO_BALLOON_PAGES_PER_PAGE); > + } > + } while (!ret); > + } > + } > + } This is pretty unreadable. Please add some indent...
2017 Apr 13
3
[PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...len) && > + !virtqueue_is_broken(vq)) > + cpu_relax(); > + else > + wait_event(vb->acked, virtqueue_get_buf(vq, &len)); > + hdr->chunks = 0; Why zero it here after device used it? Better to zero before use. > + } > +} > + > +static void add_one_chunk(struct virtio_balloon *vb, struct virtqueue *vq, > + int type, u64 base, u64 size) what are the units here? Looks like it's in 4kbyte units? > +{ > + struct virtio_balloon_page_chunk_hdr *hdr; > + struct virtio_balloon_page_chunk *chunk; > + > + switch (type) { > + ca...
2017 Apr 13
3
[PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...len) && > + !virtqueue_is_broken(vq)) > + cpu_relax(); > + else > + wait_event(vb->acked, virtqueue_get_buf(vq, &len)); > + hdr->chunks = 0; Why zero it here after device used it? Better to zero before use. > + } > +} > + > +static void add_one_chunk(struct virtio_balloon *vb, struct virtqueue *vq, > + int type, u64 base, u64 size) what are the units here? Looks like it's in 4kbyte units? > +{ > + struct virtio_balloon_page_chunk_hdr *hdr; > + struct virtio_balloon_page_chunk *chunk; > + > + switch (type) { > + ca...
2017 Apr 13
2
[PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ
...UNK_TYPE_UNUSED: > + hdr = vb->unused_page_chunk_hdr; > + len = sizeof(struct virtio_balloon_miscq_hdr); > + break; > default: > dev_warn(&vb->vdev->dev, "%s: chunk %d of unknown pages\n", > __func__, type); > @@ -254,6 +272,10 @@ static void add_one_chunk(struct virtio_balloon *vb, struct virtqueue *vq, > hdr = vb->balloon_page_chunk_hdr; > chunk = vb->balloon_page_chunk; > break; > + case PAGE_CHUNK_TYPE_UNUSED: > + hdr = vb->unused_page_chunk_hdr; > + chunk = vb->unused_page_chunk; > + break; > def...
2017 Apr 13
2
[PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ
...UNK_TYPE_UNUSED: > + hdr = vb->unused_page_chunk_hdr; > + len = sizeof(struct virtio_balloon_miscq_hdr); > + break; > default: > dev_warn(&vb->vdev->dev, "%s: chunk %d of unknown pages\n", > __func__, type); > @@ -254,6 +272,10 @@ static void add_one_chunk(struct virtio_balloon *vb, struct virtqueue *vq, > hdr = vb->balloon_page_chunk_hdr; > chunk = vb->balloon_page_chunk; > break; > + case PAGE_CHUNK_TYPE_UNUSED: > + hdr = vb->unused_page_chunk_hdr; > + chunk = vb->unused_page_chunk; > + break; > def...
2017 Apr 17
0
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...he two features( i.e. "balloon pages" and "unused pages") decoupled while trying to use common functions to deal with the commonalities. That's the reason to define the above macro. Without the macro, we will need to have separate functions, for example, instead of one "add_one_chunk()", we need to have add_one_balloon_page_chunk() and add_one_unused_page_chunk(), and some of the implementations will be kind of duplicate in the two functions. Probably we can add it when the second feature comes to the code. > >> Types of page to chunk are treated differently. Dif...
2017 Apr 14
0
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...amp;len)); >> + hdr->chunks = 0; > Why zero it here after device used it? Better to zero before use. hdr->chunks tells the host how many chunks are there in the payload. After the device use it, it is ready to zero it. > >> + } >> +} >> + >> +static void add_one_chunk(struct virtio_balloon *vb, struct virtqueue *vq, >> + int type, u64 base, u64 size) > what are the units here? Looks like it's in 4kbyte units? what is the "unit" you referred to? This is the function to add one chunk, base pfn and size of the chunk are supplied to the f...
2017 Jun 13
5
[PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...chunk_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; > + } > +} > + > +/* 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->vd...
2017 Jun 13
5
[PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...chunk_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; > + } > +} > + > +/* 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->vd...
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 Apr 26
2
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
.... "balloon pages" and "unused pages") > decoupled while trying to use common functions to deal with the commonalities. > That's the reason to define the above macro. > Without the macro, we will need to have separate functions, for example, > instead of one "add_one_chunk()", we need to have > add_one_balloon_page_chunk() and add_one_unused_page_chunk(), and some > of the implementations will be kind of duplicate in the two functions. > Probably we can add it when the second feature comes to the code. > > > > >> Types of page to chun...
2017 Apr 26
2
[virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
.... "balloon pages" and "unused pages") > decoupled while trying to use common functions to deal with the commonalities. > That's the reason to define the above macro. > Without the macro, we will need to have separate functions, for example, > instead of one "add_one_chunk()", we need to have > add_one_balloon_page_chunk() and add_one_unused_page_chunk(), and some > of the implementations will be kind of duplicate in the two functions. > Probably we can add it when the second feature comes to the code. > > > > >> Types of page to chun...
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 Jun 15
0
[virtio-dev] Re: [PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...rule here is that we always keep "1" page bmap. "1" is defined by the VIRTIO_BALLOON_PAGE_BMAP_DEFAULT_NUM. So when freeing, it 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->vd...