search for: virtio_balloon_chunk_size_shift

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

2017 Mar 03
0
[PATCH v7 kernel 2/5] virtio-balloon: VIRTIO_BALLOON_F_CHUNK_TRANSFER
...mory Stats virtqueue */ #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ +#define VIRTIO_BALLOON_F_CHUNK_TRANSFER 3 /* Transfer pages in chunks */ /* Size of a PFN in the balloon interface. */ #define VIRTIO_BALLOON_PFN_SHIFT 12 +/* Shift to get a chunk size */ +#define VIRTIO_BALLOON_CHUNK_SIZE_SHIFT 12 + struct virtio_balloon_config { /* Number of pages host wants Guest to give up. */ __u32 num_pages; @@ -82,4 +86,12 @@ struct virtio_balloon_stat { __virtio64 val; } __attribute__((packed)); +/* Response header structure */ +struct virtio_balloon_resp_hdr { + u8 cmd; + u8 flag; + __le...
2017 Mar 08
1
[PATCH v7 kernel 2/5] virtio-balloon: VIRTIO_BALLOON_F_CHUNK_TRANSFER
...RTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ > +#define VIRTIO_BALLOON_F_CHUNK_TRANSFER 3 /* Transfer pages in chunks */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > > +/* Shift to get a chunk size */ > +#define VIRTIO_BALLOON_CHUNK_SIZE_SHIFT 12 > + > struct virtio_balloon_config { > /* Number of pages host wants Guest to give up. */ > __u32 num_pages; > @@ -82,4 +86,12 @@ struct virtio_balloon_stat { > __virtio64 val; > } __attribute__((packed)); > > +/* Response header structure */ > +struct vir...
2017 Mar 08
1
[PATCH v7 kernel 2/5] virtio-balloon: VIRTIO_BALLOON_F_CHUNK_TRANSFER
...RTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ > +#define VIRTIO_BALLOON_F_CHUNK_TRANSFER 3 /* Transfer pages in chunks */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > > +/* Shift to get a chunk size */ > +#define VIRTIO_BALLOON_CHUNK_SIZE_SHIFT 12 > + > struct virtio_balloon_config { > /* Number of pages host wants Guest to give up. */ > __u32 num_pages; > @@ -82,4 +86,12 @@ struct virtio_balloon_stat { > __virtio64 val; > } __attribute__((packed)); > > +/* Response header structure */ > +struct vir...
2017 Mar 03
10
[PATCH v7 kernel 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration
Take over this work from Liang. This patch series implements two optimizations: 1) transfer pages in chuncks between the guest and host; 1) transfer the guest unused pages to the host so that they can be skipped to migrate in live migration. Please check patch 0003 for more details about optimization 1). For an idle guest with 8GB RAM, optimization 2) can help shorten the total live migration
2017 Mar 03
10
[PATCH v7 kernel 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration
Take over this work from Liang. This patch series implements two optimizations: 1) transfer pages in chuncks between the guest and host; 1) transfer the guest unused pages to the host so that they can be skipped to migrate in live migration. Please check patch 0003 for more details about optimization 1). For an idle guest with 8GB RAM, optimization 2) can help shorten the total live migration
2017 Mar 03
0
[PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER
...uffer to an empty queue. */ - virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); - virtqueue_kick(vq); +static void do_set_resp_bitmap(struct virtio_balloon *vb, unsigned long base, + int size) +{ + /* Use the extented chunk format if the size is too large */ + if (size > (1 << VIRTIO_BALLOON_CHUNK_SIZE_SHIFT)) { + struct balloon_page_chunk_ext *chunk_ext = + (struct balloon_page_chunk_ext *)(vb->resp_data + vb->resp_pos); + chunk_ext->base = cpu_to_le64(base); + chunk_ext->size = cpu_to_le64(size); + vb->resp_pos += sizeof(vb->resp_pos) / sizeof(*chunk_ext); + } else { + struct...
2017 Apr 13
0
[PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...+ break; + default: + dev_warn(&vb->vdev->dev, "%s: chunk %d of unknown pages\n", + __func__, type); + return; + } + chunk = chunk + hdr->chunks; + chunk->base = cpu_to_le64(base << VIRTIO_BALLOON_CHUNK_BASE_SHIFT); + chunk->size = cpu_to_le64(size << VIRTIO_BALLOON_CHUNK_SIZE_SHIFT); + hdr->chunks++; + if (hdr->chunks == MAX_PAGE_CHUNKS) + send_page_chunks(vb, vq, type, false); +} + +static void chunking_pages_from_bmap(struct virtio_balloon *vb, + struct virtqueue *vq, + unsigned long pfn_start, + unsigned long *bmap, + unsigned long le...
2017 May 04
0
[PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...->balloon_page_chunk; + struct virtio_balloon_page_chunk_entry *entry; + uint64_t chunk_num = le64_to_cpu(chunk->chunk_num); + + entry = &chunk->entry[chunk_num]; + entry->base = cpu_to_le64(base << VIRTIO_BALLOON_CHUNK_BASE_SHIFT); + entry->size = cpu_to_le64(size << VIRTIO_BALLOON_CHUNK_SIZE_SHIFT); + chunk->chunk_num = cpu_to_le64(++chunk_num); + if (chunk_num == VIRTIO_BALLOON_MAX_PAGE_CHUNKS) + send_page_chunks(vb, vq); +} + +static void convert_bmap_to_chunks(struct virtio_balloon *vb, + struct virtqueue *vq, + unsigned long *bmap, + unsigned long pfn_start, +...
2017 May 05
1
[PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...+ struct virtio_balloon_page_chunk_entry *entry; > + uint64_t chunk_num = le64_to_cpu(chunk->chunk_num); > + > + entry = &chunk->entry[chunk_num]; > + entry->base = cpu_to_le64(base << VIRTIO_BALLOON_CHUNK_BASE_SHIFT); > + entry->size = cpu_to_le64(size << VIRTIO_BALLOON_CHUNK_SIZE_SHIFT); > + chunk->chunk_num = cpu_to_le64(++chunk_num); > + if (chunk_num == VIRTIO_BALLOON_MAX_PAGE_CHUNKS) > + send_page_chunks(vb, vq); > +} > + > +static void convert_bmap_to_chunks(struct virtio_balloon *vb, > + struct virtqueue *vq, > + unsigned long *bmap,...
2017 May 05
1
[PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
...+ struct virtio_balloon_page_chunk_entry *entry; > + uint64_t chunk_num = le64_to_cpu(chunk->chunk_num); > + > + entry = &chunk->entry[chunk_num]; > + entry->base = cpu_to_le64(base << VIRTIO_BALLOON_CHUNK_BASE_SHIFT); > + entry->size = cpu_to_le64(size << VIRTIO_BALLOON_CHUNK_SIZE_SHIFT); > + chunk->chunk_num = cpu_to_le64(++chunk_num); > + if (chunk_num == VIRTIO_BALLOON_MAX_PAGE_CHUNKS) > + send_page_chunks(vb, vq); > +} > + > +static void convert_bmap_to_chunks(struct virtio_balloon *vb, > + struct virtqueue *vq, > + unsigned long *bmap,...
2017 Mar 08
3
[PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER
...virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); > - virtqueue_kick(vq); > +static void do_set_resp_bitmap(struct virtio_balloon *vb, unsigned long base, > + int size) > +{ > + /* Use the extented chunk format if the size is too large */ > + if (size > (1 << VIRTIO_BALLOON_CHUNK_SIZE_SHIFT)) { > + struct balloon_page_chunk_ext *chunk_ext = > + (struct balloon_page_chunk_ext *)(vb->resp_data + vb->resp_pos); > + chunk_ext->base = cpu_to_le64(base); > + chunk_ext->size = cpu_to_le64(size); > + vb->resp_pos += sizeof(vb->resp_pos) / sizeof(*chunk_e...
2017 Mar 08
3
[PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER
...virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); > - virtqueue_kick(vq); > +static void do_set_resp_bitmap(struct virtio_balloon *vb, unsigned long base, > + int size) > +{ > + /* Use the extented chunk format if the size is too large */ > + if (size > (1 << VIRTIO_BALLOON_CHUNK_SIZE_SHIFT)) { > + struct balloon_page_chunk_ext *chunk_ext = > + (struct balloon_page_chunk_ext *)(vb->resp_data + vb->resp_pos); > + chunk_ext->base = cpu_to_le64(base); > + chunk_ext->size = cpu_to_le64(size); > + vb->resp_pos += sizeof(vb->resp_pos) / sizeof(*chunk_e...
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 Mar 03
0
[PATCH v7 kernel 5/5] This patch contains two parts:
...q_vq; + int ret, order; + struct zone *zone = NULL; + bool part_fill = false; + + mutex_lock(&vb->balloon_lock); + + for (order = MAX_ORDER - 1; order >= 0; order--) { + ret = mark_unused_pages(&zone, order, vb->resp_data, + vb->resp_buf_size / sizeof(__le64), + &pos, VIRTIO_BALLOON_CHUNK_SIZE_SHIFT, part_fill); + if (ret == -ENOSPC) { + if (pos == 0) { + void *new_resp_data; + + new_resp_data = kmalloc(2 * vb->resp_buf_size, + GFP_KERNEL); + if (new_resp_data) { + kfree(vb->resp_data); + vb->resp_data = new_resp_data; + vb->resp_buf_size *= 2; + }...
2017 Apr 13
10
[PATCH v9 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration
This patch series implements two optimizations: 1) transfer pages in chuncks between the guest and host; 2) transfer the guest unused pages to the host so that they can be skipped to migrate in live migration. Changes: v8->v9: 1) Split the two new features, VIRTIO_BALLOON_F_BALLOON_CHUNKS and VIRTIO_BALLOON_F_MISC_VQ, which were mixed together in the previous implementation; 2) Simpler
2017 Apr 13
10
[PATCH v9 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration
This patch series implements two optimizations: 1) transfer pages in chuncks between the guest and host; 2) transfer the guest unused pages to the host so that they can be skipped to migrate in live migration. Changes: v8->v9: 1) Split the two new features, VIRTIO_BALLOON_F_BALLOON_CHUNKS and VIRTIO_BALLOON_F_MISC_VQ, which were mixed together in the previous implementation; 2) Simpler
2017 Mar 10
0
[virtio-dev] Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER
...&sg, 1, vb, GFP_KERNEL); >> - virtqueue_kick(vq); >> +static void do_set_resp_bitmap(struct virtio_balloon *vb, unsigned long base, >> + int size) >> +{ >> + /* Use the extented chunk format if the size is too large */ >> + if (size > (1 << VIRTIO_BALLOON_CHUNK_SIZE_SHIFT)) { >> + struct balloon_page_chunk_ext *chunk_ext = >> + (struct balloon_page_chunk_ext *)(vb->resp_data + vb->resp_pos); >> + chunk_ext->base = cpu_to_le64(base); >> + chunk_ext->size = cpu_to_le64(size); >> + vb->resp_pos += sizeof(vb->resp_po...
2017 Apr 13
3
[PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...arn(&vb->vdev->dev, "%s: chunk %d of unknown pages\n", > + __func__, type); > + return; > + } > + chunk = chunk + hdr->chunks; > + chunk->base = cpu_to_le64(base << VIRTIO_BALLOON_CHUNK_BASE_SHIFT); > + chunk->size = cpu_to_le64(size << VIRTIO_BALLOON_CHUNK_SIZE_SHIFT); > + hdr->chunks++; Isn't this LE? You should keep it somewhere else. > + if (hdr->chunks == MAX_PAGE_CHUNKS) > + send_page_chunks(vb, vq, type, false); and zero chunks here? > +} > + > +static void chunking_pages_from_bmap(struct virtio_balloon *vb, Does this mea...
2017 Apr 13
3
[PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
...arn(&vb->vdev->dev, "%s: chunk %d of unknown pages\n", > + __func__, type); > + return; > + } > + chunk = chunk + hdr->chunks; > + chunk->base = cpu_to_le64(base << VIRTIO_BALLOON_CHUNK_BASE_SHIFT); > + chunk->size = cpu_to_le64(size << VIRTIO_BALLOON_CHUNK_SIZE_SHIFT); > + hdr->chunks++; Isn't this LE? You should keep it somewhere else. > + if (hdr->chunks == MAX_PAGE_CHUNKS) > + send_page_chunks(vb, vq, type, false); and zero chunks here? > +} > + > +static void chunking_pages_from_bmap(struct virtio_balloon *vb, Does this mea...