Displaying 20 results from an estimated 30 matches for "send_balloon_page_sg".
2017 Sep 08
2
[PATCH v15 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...e *vq, void *addr, uint32_t size)
> > > +{
> > > + struct scatterlist sg;
> > > +
> > > + sg_init_one(&sg, addr, size);
> > > + return virtqueue_add_inbuf(vq, &sg, 1, vq, GFP_KERNEL);
> > > +}
> > > +
> > > +static void send_balloon_page_sg(struct virtio_balloon *vb,
> > > + struct virtqueue *vq,
> > > + void *addr,
> > > + uint32_t size,
> > > + bool batch)
> > > +{
> > > + unsigned int len;
> > > + int err;
> > > +
> > > + err = add_one_...
2017 Sep 08
2
[PATCH v15 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...e *vq, void *addr, uint32_t size)
> > > +{
> > > + struct scatterlist sg;
> > > +
> > > + sg_init_one(&sg, addr, size);
> > > + return virtqueue_add_inbuf(vq, &sg, 1, vq, GFP_KERNEL);
> > > +}
> > > +
> > > +static void send_balloon_page_sg(struct virtio_balloon *vb,
> > > + struct virtqueue *vq,
> > > + void *addr,
> > > + uint32_t size,
> > > + bool batch)
> > > +{
> > > + unsigned int len;
> > > + int err;
> > > +
> > > + err = add_one_...
2017 Oct 02
2
[PATCH v16 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...sg;
> + unsigned int len;
> +
> + sg_init_one(&sg, addr, size);
> +
> + /* Detach all the used buffers from the vq */
> + while (virtqueue_get_buf(vq, &len))
> + ;
> +
> + return virtqueue_add_inbuf(vq, &sg, 1, vq, GFP_KERNEL);
> +}
> +
> +static int send_balloon_page_sg(struct virtio_balloon *vb,
> + struct virtqueue *vq,
> + void *addr,
> + uint32_t size,
> + bool batch)
> +{
> + int err;
> +
> + err = add_one_sg(vq, addr, size);
> +
> + /* If batchng is requested, we batch till the vq is full */
typo
> + if (!ba...
2017 Oct 02
2
[PATCH v16 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...sg;
> + unsigned int len;
> +
> + sg_init_one(&sg, addr, size);
> +
> + /* Detach all the used buffers from the vq */
> + while (virtqueue_get_buf(vq, &len))
> + ;
> +
> + return virtqueue_add_inbuf(vq, &sg, 1, vq, GFP_KERNEL);
> +}
> +
> +static int send_balloon_page_sg(struct virtio_balloon *vb,
> + struct virtqueue *vq,
> + void *addr,
> + uint32_t size,
> + bool batch)
> +{
> + int err;
> +
> + err = add_one_sg(vq, addr, size);
> +
> + /* If batchng is requested, we batch till the vq is full */
typo
> + if (!ba...
2017 Sep 29
1
[virtio-dev] Re: [PATCH v15 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...; > + struct scatterlist sg;
> > > > > +
> > > > > + sg_init_one(&sg, addr, size);
> > > > > + return virtqueue_add_inbuf(vq, &sg, 1, vq, GFP_KERNEL);
> > > > > +}
> > > > > +
> > > > > +static void send_balloon_page_sg(struct virtio_balloon *vb,
> > > > > + struct virtqueue *vq,
> > > > > + void *addr,
> > > > > + uint32_t size,
> > > > > + bool batch)
> > > > > +{
> > > > > + unsigned int len;
> > >...
2017 Sep 29
1
[virtio-dev] Re: [PATCH v15 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...; > + struct scatterlist sg;
> > > > > +
> > > > > + sg_init_one(&sg, addr, size);
> > > > > + return virtqueue_add_inbuf(vq, &sg, 1, vq, GFP_KERNEL);
> > > > > +}
> > > > > +
> > > > > +static void send_balloon_page_sg(struct virtio_balloon *vb,
> > > > > + struct virtqueue *vq,
> > > > > + void *addr,
> > > > > + uint32_t size,
> > > > > + bool batch)
> > > > > +{
> > > > > + unsigned int len;
> > >...
2017 Nov 03
0
[PATCH v17 4/6] virtio-balloon: VIRTIO_BALLOON_F_SG
...ue *vq, void *addr, uint32_t size)
+{
+ struct scatterlist sg;
+ unsigned int len;
+
+ sg_init_one(&sg, addr, size);
+
+ /* Detach all the used buffers from the vq */
+ while (virtqueue_get_buf(vq, &len))
+ ;
+
+ return virtqueue_add_inbuf(vq, &sg, 1, vq, GFP_KERNEL);
+}
+
+static void send_balloon_page_sg(struct virtio_balloon *vb,
+ struct virtqueue *vq,
+ void *addr,
+ uint32_t size,
+ bool batch)
+{
+ int err;
+
+ err = add_one_sg(vq, addr, size);
+ /*
+ * This is expected to never fail: there is always at least 1 entry
+ * available on the vq, because when the vq is full the wo...
2017 Sep 30
0
[PATCH v16 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...eue *vq, void *addr, uint32_t size)
+{
+ struct scatterlist sg;
+ unsigned int len;
+
+ sg_init_one(&sg, addr, size);
+
+ /* Detach all the used buffers from the vq */
+ while (virtqueue_get_buf(vq, &len))
+ ;
+
+ return virtqueue_add_inbuf(vq, &sg, 1, vq, GFP_KERNEL);
+}
+
+static int send_balloon_page_sg(struct virtio_balloon *vb,
+ struct virtqueue *vq,
+ void *addr,
+ uint32_t size,
+ bool batch)
+{
+ int err;
+
+ err = add_one_sg(vq, addr, size);
+
+ /* If batchng is requested, we batch till the vq is full */
+ if (!batch || !vq->num_free)
+ kick_and_wait(vq, vb->acked);
+...
2017 Sep 08
0
[virtio-dev] Re: [PATCH v15 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...r, uint32_t size)
>>>> +{
>>>> + struct scatterlist sg;
>>>> +
>>>> + sg_init_one(&sg, addr, size);
>>>> + return virtqueue_add_inbuf(vq, &sg, 1, vq, GFP_KERNEL);
>>>> +}
>>>> +
>>>> +static void send_balloon_page_sg(struct virtio_balloon *vb,
>>>> + struct virtqueue *vq,
>>>> + void *addr,
>>>> + uint32_t size,
>>>> + bool batch)
>>>> +{
>>>> + unsigned int len;
>>>> + int err;
>>>> +
>>>>...
2017 Nov 03
2
[PATCH v17 4/6] virtio-balloon: VIRTIO_BALLOON_F_SG
Wei Wang wrote:
> @@ -164,6 +284,8 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num)
> break;
> }
>
> + if (use_sg && xb_set_page(vb, page, &pfn_min, &pfn_max) < 0)
Isn't this leaking "page" ?
> + break;
> balloon_page_push(&pages, page);
> }
>
> @@ -184,8 +307,12 @@ static unsigned
2017 Nov 03
2
[PATCH v17 4/6] virtio-balloon: VIRTIO_BALLOON_F_SG
Wei Wang wrote:
> @@ -164,6 +284,8 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num)
> break;
> }
>
> + if (use_sg && xb_set_page(vb, page, &pfn_min, &pfn_max) < 0)
Isn't this leaking "page" ?
> + break;
> balloon_page_push(&pages, page);
> }
>
> @@ -184,8 +307,12 @@ static unsigned
2017 Sep 30
12
[PATCH v16 0/5] 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 using sgs, instead of one array each time; and
2) free page block reporting: a new virtqueue to report guest free pages
to the host.
The second feature can be used to accelerate live migration of VMs. Here
are some details:
Live
2017 Sep 30
12
[PATCH v16 0/5] 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 using sgs, instead of one array each time; and
2) free page block reporting: a new virtqueue to report guest free pages
to the host.
The second feature can be used to accelerate live migration of VMs. Here
are some details:
Live
2017 Oct 02
0
[PATCH v16 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
On Monday, October 2, 2017 12:30 PM, Michael S. Tsirkin wrote:
> On Sat, Sep 30, 2017 at 12:05:52PM +0800, Wei Wang wrote:
> > +static int send_balloon_page_sg(struct virtio_balloon *vb,
> > + struct virtqueue *vq,
> > + void *addr,
> > + uint32_t size,
> > + bool batch)
> > +{
> > + int err;
> > +
> > + err = add_one_sg(vq, addr, size);
> > +
> > + /* If batchng is requested, we...
2017 Nov 04
0
[PATCH v17 4/6] virtio-balloon: VIRTIO_BALLOON_F_SG
...pfns) {
>> + if (use_sg)
>> + tell_host_sgs(vb, vb->inflate_vq, pfn_min, pfn_max);
> Please describe why tell_host_sgs() can work without __GFP_DIRECT_RECLAIM allocation,
> for tell_host_sgs() is called with vb->balloon_lock mutex held.
Essentially,
tell_host_sgs()-->send_balloon_page_sg()-->add_one_sg()-->virtqueue_add_inbuf(
, , num=1 ,,GFP_KERNEL)
won't need any memory allocation, because we always add one sg (i.e.
num=1) each time. That memory
allocation option is only used when multiple sgs are added (i.e. num >
1) and the implementation inside virtqueue_add_in...
2017 Nov 04
1
[PATCH v17 4/6] virtio-balloon: VIRTIO_BALLOON_F_SG
...)
> >> + tell_host_sgs(vb, vb->inflate_vq, pfn_min, pfn_max);
> > Please describe why tell_host_sgs() can work without __GFP_DIRECT_RECLAIM allocation,
> > for tell_host_sgs() is called with vb->balloon_lock mutex held.
>
> Essentially,
> tell_host_sgs()-->send_balloon_page_sg()-->add_one_sg()-->virtqueue_add_inbuf(
> , , num=1 ,,GFP_KERNEL)
> won't need any memory allocation, because we always add one sg (i.e.
> num=1) each time. That memory
> allocation option is only used when multiple sgs are added (i.e. num >
> 1) and the implementatio...
2017 Nov 04
1
[PATCH v17 4/6] virtio-balloon: VIRTIO_BALLOON_F_SG
...)
> >> + tell_host_sgs(vb, vb->inflate_vq, pfn_min, pfn_max);
> > Please describe why tell_host_sgs() can work without __GFP_DIRECT_RECLAIM allocation,
> > for tell_host_sgs() is called with vb->balloon_lock mutex held.
>
> Essentially,
> tell_host_sgs()-->send_balloon_page_sg()-->add_one_sg()-->virtqueue_add_inbuf(
> , , num=1 ,,GFP_KERNEL)
> won't need any memory allocation, because we always add one sg (i.e.
> num=1) each time. That memory
> allocation option is only used when multiple sgs are added (i.e. num >
> 1) and the implementatio...
2017 Nov 03
12
[PATCH v17 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 using sgs, instead of one array each time; and
2) free page block reporting: a new virtqueue to report guest free pages
to the host.
The second feature can be used to accelerate live migration of VMs. Here
are some details:
Live
2017 Nov 03
12
[PATCH v17 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 using sgs, instead of one array each time; and
2) free page block reporting: a new virtqueue to report guest free pages
to the host.
The second feature can be used to accelerate live migration of VMs. Here
are some details:
Live
2017 Sep 05
0
[PATCH v15 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ
...ee page report */
> + struct virtio_balloon_ctrlq_cmd free_page_cmd_in;
> + /* Guest to Host ctrlq cmd buf for free page report */
> + struct virtio_balloon_ctrlq_cmd free_page_cmd_out;
> };
>
> static struct virtio_device_id id_table[] = { @@ -177,6 +191,26 @@ static void
> send_balloon_page_sg(struct virtio_balloon *vb,
> }
> }
>
> +static void send_free_page_sg(struct virtqueue *vq, void *addr,
> +uint32_t size) {
> + unsigned int len;
> + int err = -ENOSPC;
> +
> + do {
> + if (vq->num_free) {
> + err = add_one_sg(vq, addr, size);
> + /*...