search for: balloon_bmap_hdr

Displaying 20 results from an estimated 37 matches for "balloon_bmap_hdr".

2016 Jul 27
4
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...26/2016 06:23 PM, Liang Li wrote: > + vb->pfn_limit = VIRTIO_BALLOON_PFNS_LIMIT; > + vb->pfn_limit = min(vb->pfn_limit, get_max_pfn()); > + vb->bmap_len = ALIGN(vb->pfn_limit, BITS_PER_LONG) / > + BITS_PER_BYTE + 2 * sizeof(unsigned long); > + hdr_len = sizeof(struct balloon_bmap_hdr); > + vb->bmap_hdr = kzalloc(hdr_len + vb->bmap_len, GFP_KERNEL); This ends up doing a 1MB kmalloc() right? That seems a _bit_ big. How big was the pfn buffer before?
2016 Jul 27
4
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...26/2016 06:23 PM, Liang Li wrote: > + vb->pfn_limit = VIRTIO_BALLOON_PFNS_LIMIT; > + vb->pfn_limit = min(vb->pfn_limit, get_max_pfn()); > + vb->bmap_len = ALIGN(vb->pfn_limit, BITS_PER_LONG) / > + BITS_PER_BYTE + 2 * sizeof(unsigned long); > + hdr_len = sizeof(struct balloon_bmap_hdr); > + vb->bmap_hdr = kzalloc(hdr_len + vb->bmap_len, GFP_KERNEL); This ends up doing a 1MB kmalloc() right? That seems a _bit_ big. How big was the pfn buffer before?
2016 Oct 24
1
[RESEND PATCH v3 kernel 2/7] virtio-balloon: define new feature bit and page bitmap head
...end page info with bitmap */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > @@ -82,4 +83,22 @@ struct virtio_balloon_stat { > __virtio64 val; > } __attribute__((packed)); > > +/* Page bitmap header structure */ > +struct balloon_bmap_hdr { > + /* Used to distinguish different request */ > + __virtio16 cmd; > + /* Shift width of page in the bitmap */ > + __virtio16 page_shift; > + /* flag used to identify different status */ > + __virtio16 flag; > + /* Reserved */ > + __virtio16 reserved; > + /* ID of the...
2016 Oct 24
1
[RESEND PATCH v3 kernel 2/7] virtio-balloon: define new feature bit and page bitmap head
...end page info with bitmap */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > @@ -82,4 +83,22 @@ struct virtio_balloon_stat { > __virtio64 val; > } __attribute__((packed)); > > +/* Page bitmap header structure */ > +struct balloon_bmap_hdr { > + /* Used to distinguish different request */ > + __virtio16 cmd; > + /* Shift width of page in the bitmap */ > + __virtio16 page_shift; > + /* flag used to identify different status */ > + __virtio16 flag; > + /* Reserved */ > + __virtio16 reserved; > + /* ID of the...
2016 Jul 27
2
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
..._host(struct virtio_balloon *vb, struct virtqueue *vq) > { > struct scatterlist sg; > unsigned int len; > > - sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns); > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_PAGE_BITMAP)) { > + struct balloon_bmap_hdr *hdr = vb->bmap_hdr; > + unsigned long bmap_len; > + > + /* cmd and req_id are not used here, set them to 0 */ > + hdr->cmd = cpu_to_virtio16(vb->vdev, 0); > + hdr->page_shift = cpu_to_virtio16(vb->vdev, PAGE_SHIFT); > + hdr->reserved = cpu_to_virtio16(vb-&g...
2016 Jul 27
2
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
..._host(struct virtio_balloon *vb, struct virtqueue *vq) > { > struct scatterlist sg; > unsigned int len; > > - sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns); > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_PAGE_BITMAP)) { > + struct balloon_bmap_hdr *hdr = vb->bmap_hdr; > + unsigned long bmap_len; > + > + /* cmd and req_id are not used here, set them to 0 */ > + hdr->cmd = cpu_to_virtio16(vb->vdev, 0); > + hdr->page_shift = cpu_to_virtio16(vb->vdev, PAGE_SHIFT); > + hdr->reserved = cpu_to_virtio16(vb-&g...
2016 Jul 28
2
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...vb->pfn_limit = VIRTIO_BALLOON_PFNS_LIMIT; > > > + vb->pfn_limit = min(vb->pfn_limit, get_max_pfn()); > > > + vb->bmap_len = ALIGN(vb->pfn_limit, BITS_PER_LONG) / > > > + BITS_PER_BYTE + 2 * sizeof(unsigned long); > > > + hdr_len = sizeof(struct balloon_bmap_hdr); > > > + vb->bmap_hdr = kzalloc(hdr_len + vb->bmap_len, GFP_KERNEL); > > > > This ends up doing a 1MB kmalloc() right? That seems a _bit_ big. > > How big was the pfn buffer before? > > > Yes I would limit this to 1G memory in a go, will result in a 32K...
2016 Jul 28
2
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...vb->pfn_limit = VIRTIO_BALLOON_PFNS_LIMIT; > > > + vb->pfn_limit = min(vb->pfn_limit, get_max_pfn()); > > > + vb->bmap_len = ALIGN(vb->pfn_limit, BITS_PER_LONG) / > > > + BITS_PER_BYTE + 2 * sizeof(unsigned long); > > > + hdr_len = sizeof(struct balloon_bmap_hdr); > > > + vb->bmap_hdr = kzalloc(hdr_len + vb->bmap_len, GFP_KERNEL); > > > > This ends up doing a 1MB kmalloc() right? That seems a _bit_ big. > > How big was the pfn buffer before? > > > Yes I would limit this to 1G memory in a go, will result in a 32K...
2016 Oct 21
16
[RESEND PATCH v3 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration
This patch set contains two parts of changes to the virtio-balloon. One is the change for speeding up the inflating & deflating process, the main idea of this optimization is to use bitmap to send the page information to host instead of the PFNs, to reduce the overhead of virtio data transmission, address translation and madvise(). This can help to improve the performance by about 85%.
2016 Oct 21
16
[RESEND PATCH v3 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration
This patch set contains two parts of changes to the virtio-balloon. One is the change for speeding up the inflating & deflating process, the main idea of this optimization is to use bitmap to send the page information to host instead of the PFNs, to reduce the overhead of virtio data transmission, address translation and madvise(). This can help to improve the performance by about 85%.
2016 Jul 27
2
[PATCH v2 repost 7/7] virtio-balloon: tell host vm's free page info
...vailable)); > } > > +static void update_free_pages_stats(struct virtio_balloon *vb, why _stats? > + unsigned long req_id) > +{ > + struct scatterlist sg_in, sg_out; > + unsigned long pfn = 0, bmap_len, max_pfn; > + struct virtqueue *vq = vb->misc_vq; > + struct balloon_bmap_hdr *hdr = vb->bmap_hdr; > + int ret = 1; > + > + max_pfn = get_max_pfn(); > + mutex_lock(&vb->balloon_lock); > + while (pfn < max_pfn) { > + memset(vb->page_bitmap, 0, vb->bmap_len); > + ret = get_free_pages(pfn, pfn + vb->pfn_limit, > + vb->page_bi...
2016 Jul 27
2
[PATCH v2 repost 7/7] virtio-balloon: tell host vm's free page info
...vailable)); > } > > +static void update_free_pages_stats(struct virtio_balloon *vb, why _stats? > + unsigned long req_id) > +{ > + struct scatterlist sg_in, sg_out; > + unsigned long pfn = 0, bmap_len, max_pfn; > + struct virtqueue *vq = vb->misc_vq; > + struct balloon_bmap_hdr *hdr = vb->bmap_hdr; > + int ret = 1; > + > + max_pfn = get_max_pfn(); > + mutex_lock(&vb->balloon_lock); > + while (pfn < max_pfn) { > + memset(vb->page_bitmap, 0, vb->bmap_len); > + ret = get_free_pages(pfn, pfn + vb->pfn_limit, > + vb->page_bi...
2016 Jul 27
14
[PATCH v2 repost 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration
This patchset is for kernel and contains two parts of change to the virtio-balloon. One is the change for speeding up the inflating & deflating process, the main idea of this optimization is to use bitmap to send the page information to host instead of the PFNs, to reduce the overhead of virtio data transmission, address translation and madvise(). This can help to improve the performance by
2016 Jul 27
14
[PATCH v2 repost 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration
This patchset is for kernel and contains two parts of change to the virtio-balloon. One is the change for speeding up the inflating & deflating process, the main idea of this optimization is to use bitmap to send the page information to host instead of the PFNs, to reduce the overhead of virtio data transmission, address translation and madvise(). This can help to improve the performance by
2016 Oct 25
1
[RESEND PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...st(struct virtio_balloon *vb, struct virtqueue *vq) > { > - struct scatterlist sg; > - unsigned int len; > + struct scatterlist sg, sg2[BALLOON_BMAP_COUNT + 1]; > + unsigned int len, i; > + > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_PAGE_BITMAP)) { > + struct balloon_bmap_hdr *hdr = vb->bmap_hdr; > + unsigned long bmap_len; > + int nr_pfn, nr_used_bmap, nr_buf; > + > + nr_pfn = vb->end_pfn - vb->start_pfn + 1; > + nr_pfn = roundup(nr_pfn, BITS_PER_LONG); > + nr_used_bmap = nr_pfn / PFNS_PER_BMAP; > + bmap_len = nr_pfn / BITS_PER_BYTE;...
2016 Oct 25
1
[RESEND PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...st(struct virtio_balloon *vb, struct virtqueue *vq) > { > - struct scatterlist sg; > - unsigned int len; > + struct scatterlist sg, sg2[BALLOON_BMAP_COUNT + 1]; > + unsigned int len, i; > + > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_PAGE_BITMAP)) { > + struct balloon_bmap_hdr *hdr = vb->bmap_hdr; > + unsigned long bmap_len; > + int nr_pfn, nr_used_bmap, nr_buf; > + > + nr_pfn = vb->end_pfn - vb->start_pfn + 1; > + nr_pfn = roundup(nr_pfn, BITS_PER_LONG); > + nr_used_bmap = nr_pfn / PFNS_PER_BMAP; > + bmap_len = nr_pfn / BITS_PER_BYTE;...
2016 Jul 28
0
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...s the reason for this selection. > > Still applies here. > I will add the comment for this. > > - sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns); > > + if (virtio_has_feature(vb->vdev, > VIRTIO_BALLOON_F_PAGE_BITMAP)) { > > + struct balloon_bmap_hdr *hdr = vb->bmap_hdr; > > + unsigned long bmap_len; > > + > > + /* cmd and req_id are not used here, set them to 0 */ > > + hdr->cmd = cpu_to_virtio16(vb->vdev, 0); > > + hdr->page_shift = cpu_to_virtio16(vb->vdev, PAGE_SHIFT); > > + hdr->re...
2016 Jul 28
1
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...gt; Still applies here. > > > > I will add the comment for this. > > > > - sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns); > > > + if (virtio_has_feature(vb->vdev, > > VIRTIO_BALLOON_F_PAGE_BITMAP)) { > > > + struct balloon_bmap_hdr *hdr = vb->bmap_hdr; > > > + unsigned long bmap_len; > > > + > > > + /* cmd and req_id are not used here, set them to 0 */ > > > + hdr->cmd = cpu_to_virtio16(vb->vdev, 0); > > > + hdr->page_shift = cpu_to_virtio16(vb->vdev, PAGE_SHIFT)...
2016 Jul 28
1
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...gt; Still applies here. > > > > I will add the comment for this. > > > > - sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns); > > > + if (virtio_has_feature(vb->vdev, > > VIRTIO_BALLOON_F_PAGE_BITMAP)) { > > > + struct balloon_bmap_hdr *hdr = vb->bmap_hdr; > > > + unsigned long bmap_len; > > > + > > > + /* cmd and req_id are not used here, set them to 0 */ > > > + hdr->cmd = cpu_to_virtio16(vb->vdev, 0); > > > + hdr->page_shift = cpu_to_virtio16(vb->vdev, PAGE_SHIFT)...
2016 Aug 08
0
[PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...= balloon_pfn; +} + static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) { - struct scatterlist sg; - unsigned int len; + struct scatterlist sg, sg2[BALLOON_BMAP_COUNT + 1]; + unsigned int len, i; + + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_PAGE_BITMAP)) { + struct balloon_bmap_hdr *hdr = vb->bmap_hdr; + unsigned long bmap_len; + int nr_pfn, nr_used_bmap, nr_buf; + + nr_pfn = vb->end_pfn - vb->start_pfn + 1; + nr_pfn = roundup(nr_pfn, BITS_PER_LONG); + nr_used_bmap = nr_pfn / PFNS_PER_BMAP; + bmap_len = nr_pfn / BITS_PER_BYTE; + nr_buf = nr_used_bmap + 1; + +...