Displaying 20 results from an estimated 97 matches for "bmap_len".
2016 May 24
2
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns);
> > > > + if (virtio_has_feature(vb->vdev,
> > > VIRTIO_BALLOON_F_PAGE_BITMAP)) {
> > > > + u32 page_shift = PAGE_SHIFT;
> > > > + unsigned long start_pfn, end_pfn, flags = 0, bmap_len;
> > > > + struct scatterlist sg[5];
> > > > +
> > > > + start_pfn = rounddown(vb->start_pfn, BITS_PER_LONG);
> > > > + end_pfn = roundup(vb->end_pfn, BITS_PER_LONG);
> > > > + bmap_len = (end_pfn - start_pfn) / BITS_PER_LONG *
&...
2016 May 24
2
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns);
> > > > + if (virtio_has_feature(vb->vdev,
> > > VIRTIO_BALLOON_F_PAGE_BITMAP)) {
> > > > + u32 page_shift = PAGE_SHIFT;
> > > > + unsigned long start_pfn, end_pfn, flags = 0, bmap_len;
> > > > + struct scatterlist sg[5];
> > > > +
> > > > + start_pfn = rounddown(vb->start_pfn, BITS_PER_LONG);
> > > > + end_pfn = roundup(vb->end_pfn, BITS_PER_LONG);
> > > > + bmap_len = (end_pfn - start_pfn) / BITS_PER_LONG *
&...
2016 Jul 27
2
[PATCH v2 repost 7/7] virtio-balloon: tell host vm's free page info
...void update_balloon_stats(struct virtio_balloon *vb)
> pages_to_bytes(available));
> }
>
> +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_...
2016 Jul 27
2
[PATCH v2 repost 7/7] virtio-balloon: tell host vm's free page info
...void update_balloon_stats(struct virtio_balloon *vb)
> pages_to_bytes(available));
> }
>
> +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_...
2016 May 24
3
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...;
> Sounds good, but you also need to limit by allocated bitmap size.
Why should we limit the page bitmap size? Is it no good to send a large page bitmap?
or to save the memory used for page bitmap? Or some other reason?
>
> >
> > + unsigned long start_pfn, end_pfn, flags = 0, bmap_len;
> > + struct scatterlist sg[5];
> > +
> > + start_pfn = rounddown(vb->start_pfn, BITS_PER_LONG);
> > + end_pfn = roundup(vb->end_pfn, BITS_PER_LONG);
> > + bmap_len = (end_pfn - start_pfn) / BITS_PER_LONG *
> sizeof(long);
> > +
> > + sg_init...
2016 May 24
3
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...;
> Sounds good, but you also need to limit by allocated bitmap size.
Why should we limit the page bitmap size? Is it no good to send a large page bitmap?
or to save the memory used for page bitmap? Or some other reason?
>
> >
> > + unsigned long start_pfn, end_pfn, flags = 0, bmap_len;
> > + struct scatterlist sg[5];
> > +
> > + start_pfn = rounddown(vb->start_pfn, BITS_PER_LONG);
> > + end_pfn = roundup(vb->end_pfn, BITS_PER_LONG);
> > + bmap_len = (end_pfn - start_pfn) / BITS_PER_LONG *
> sizeof(long);
> > +
> > + sg_init...
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
..._device *vdev;
struct virtqueue *inflate_vq, *deflate_vq, *stats_vq;
@@ -62,6 +64,9 @@ struct virtio_balloon {
/* Number of balloon pages we've told the Host we're not using. */
unsigned int num_pages;
+ unsigned long *page_bitmap;
+ unsigned long start_pfn, end_pfn;
+ unsigned long bmap_len;
/*
* The pages we've told the Host we're not using are enqueued
* at vb_dev_info->pages list.
@@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq)
wake_up(&vb->acked);
}
+static int balloon_page_bitmap_init(struct virtio_balloon *vb)
+{
+ unsigned long...
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
..._device *vdev;
struct virtqueue *inflate_vq, *deflate_vq, *stats_vq;
@@ -62,6 +64,9 @@ struct virtio_balloon {
/* Number of balloon pages we've told the Host we're not using. */
unsigned int num_pages;
+ unsigned long *page_bitmap;
+ unsigned long start_pfn, end_pfn;
+ unsigned long bmap_len;
/*
* The pages we've told the Host we're not using are enqueued
* at vb_dev_info->pages list.
@@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq)
wake_up(&vb->acked);
}
+static int balloon_page_bitmap_init(struct virtio_balloon *vb)
+{
+ unsigned long...
2016 May 24
0
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...->pfns, sizeof(vb->pfns[0]) * vb->num_pfns);
> > > > > + if (virtio_has_feature(vb->vdev,
> > > > VIRTIO_BALLOON_F_PAGE_BITMAP)) {
> > > > > + u32 page_shift = PAGE_SHIFT;
> > > > > + unsigned long start_pfn, end_pfn, flags = 0, bmap_len;
> > > > > + struct scatterlist sg[5];
> > > > > +
> > > > > + start_pfn = rounddown(vb->start_pfn, BITS_PER_LONG);
> > > > > + end_pfn = roundup(vb->end_pfn, BITS_PER_LONG);
> > > > > + bmap_len = (end_pfn - start...
2016 Jul 27
4
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
On 07/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...
2016 Jul 27
4
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
On 07/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...
2016 May 24
4
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...q; @@ -62,6 +64,9
> > @@ struct virtio_balloon {
> >
> > /* Number of balloon pages we've told the Host we're not using. */
> > unsigned int num_pages;
> > + unsigned long *page_bitmap;
> > + unsigned long start_pfn, end_pfn;
> > + unsigned long bmap_len;
> > /*
> > * The pages we've told the Host we're not using are enqueued
> > * at vb_dev_info->pages list.
> > @@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq)
> > wake_up(&vb->acked);
> > }
> >
> > +sta...
2016 May 24
4
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...q; @@ -62,6 +64,9
> > @@ struct virtio_balloon {
> >
> > /* Number of balloon pages we've told the Host we're not using. */
> > unsigned int num_pages;
> > + unsigned long *page_bitmap;
> > + unsigned long start_pfn, end_pfn;
> > + unsigned long bmap_len;
> > /*
> > * The pages we've told the Host we're not using are enqueued
> > * at vb_dev_info->pages list.
> > @@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq)
> > wake_up(&vb->acked);
> > }
> >
> > +sta...
2016 Jul 28
0
[PATCH v2 repost 7/7] virtio-balloon: tell host vm's free page info
...}
> >
> > +static void update_free_pages_stats(struct virtio_balloon *vb,
>
> why _stats?
Will change.
> > + 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_bitmap, vb->bmap_len * BITS_PER_BYTE);
> > + hdr->cmd = cpu_to_virtio16(vb->vdev,
> BALLOON_GET_FREE_PAGES);
> > + hdr->page_shift = cpu_to_virtio16(vb->vdev, PAGE_SHIFT);
>...
2016 Jul 27
0
[PATCH v2 repost 7/7] virtio-balloon: tell host vm's free page info
..._dev_info->pages list.
@@ -373,6 +378,49 @@ static void update_balloon_stats(struct virtio_balloon *vb)
pages_to_bytes(available));
}
+static void update_free_pages_stats(struct virtio_balloon *vb,
+ 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 +...
2016 Oct 25
1
[RESEND PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...; - 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;
> +
> + /* c...
2016 Oct 25
1
[RESEND PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...; - 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;
> +
> + /* c...
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 Nov 30
2
[PATCH kernel v5 5/5] virtio-balloon: tell host vm's unused page info
...vb->resp_buf_size *= 2;
What happens to the data in ->resp_data at this point? Doesn't this
just throw it away?
...
> +struct page_info_item {
> + __le64 start_pfn : 52; /* start pfn for the bitmap */
> + __le64 page_shift : 6; /* page shift width, in bytes */
> + __le64 bmap_len : 6; /* bitmap length, in bytes */
> +};
Is 'bmap_len' too short? a 64-byte buffer is a bit tiny. Right?
> +static int mark_unused_pages(struct zone *zone,
> + unsigned long *unused_pages, unsigned long size,
> + int order, unsigned long *pos)
> +{
> + unsigned lon...