search for: add_one_sg

Displaying 20 results from an estimated 99 matches for "add_one_sg".

2017 Oct 02
2
[PATCH v16 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...page_to_balloon_pfn(page) + i); > } > > + > +static void kick_and_wait(struct virtqueue *vq, wait_queue_head_t wq_head) > +{ > + unsigned int len; > + > + virtqueue_kick(vq); > + wait_event(wq_head, virtqueue_get_buf(vq, &len)); > +} > + > +static int add_one_sg(struct virtqueue *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 v...
2017 Oct 02
2
[PATCH v16 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...page_to_balloon_pfn(page) + i); > } > > + > +static void kick_and_wait(struct virtqueue *vq, wait_queue_head_t wq_head) > +{ > + unsigned int len; > + > + virtqueue_kick(vq); > + wait_event(wq_head, virtqueue_get_buf(vq, &len)); > +} > + > +static int add_one_sg(struct virtqueue *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 v...
2017 Sep 08
2
[PATCH v15 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...> > > unsigned int num_pfns; > > > __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; > > > @@ -141,13 +146,111 @@ static void set_page_pfns(struct virtio_balloon *vb, > > > page_to_balloon_pfn(page) + i); > > > } > > > +static int add_one_sg(struct virtqueue *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); > > > +} > > > + > > &g...
2017 Sep 08
2
[PATCH v15 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...> > > unsigned int num_pfns; > > > __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; > > > @@ -141,13 +146,111 @@ static void set_page_pfns(struct virtio_balloon *vb, > > > page_to_balloon_pfn(page) + i); > > > } > > > +static int add_one_sg(struct virtqueue *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); > > > +} > > > + > > &g...
2017 Oct 02
0
[PATCH v16 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...017 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 batch till the vq is full */ > > typo > > > + if (!batch || !vq->num_free) > > + kick_and_wait(vq, vb->acked); > > + > > + return err; > > +} > > If add_one_sg fails, kick_...
2017 Sep 29
1
[virtio-dev] Re: [PATCH v15 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...t; > > __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; > > > > > @@ -141,13 +146,111 @@ static void set_page_pfns(struct virtio_balloon *vb, > > > > > page_to_balloon_pfn(page) + i); > > > > > } > > > > > +static int add_one_sg(struct virtqueue *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...
2017 Sep 29
1
[virtio-dev] Re: [PATCH v15 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...t; > > __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; > > > > > @@ -141,13 +146,111 @@ static void set_page_pfns(struct virtio_balloon *vb, > > > > > page_to_balloon_pfn(page) + i); > > > > > } > > > > > +static int add_one_sg(struct virtqueue *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...
2018 Apr 03
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...__func__); > + return ret; > + } > virtqueue_kick(vb->stats_vq); > } > + > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) > + vb->free_page_vq = vqs[VIRTIO_BALLOON_VQ_FREE_PAGE]; > + > return 0; > } > > +static int add_one_sg(struct virtqueue *vq, unsigned long pfn, uint32_t len) > +{ > + struct scatterlist sg; > + unsigned int unused; > + > + sg_init_table(&sg, 1); > + sg_set_page(&sg, pfn_to_page(pfn), len, 0); > + > + /* Detach all the used buffers from the vq */ > + while (virtqueu...
2018 Apr 03
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...__func__); > + return ret; > + } > virtqueue_kick(vb->stats_vq); > } > + > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) > + vb->free_page_vq = vqs[VIRTIO_BALLOON_VQ_FREE_PAGE]; > + > return 0; > } > > +static int add_one_sg(struct virtqueue *vq, unsigned long pfn, uint32_t len) > +{ > + struct scatterlist sg; > + unsigned int unused; > + > + sg_init_table(&sg, 1); > + sg_set_page(&sg, pfn_to_page(pfn), len, 0); > + > + /* Detach all the used buffers from the vq */ > + while (virtqueu...
2017 Sep 08
0
[virtio-dev] Re: [PATCH v15 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG
...unsigned int num_pfns; >>>> __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; >>>> @@ -141,13 +146,111 @@ static void set_page_pfns(struct virtio_balloon *vb, >>>> page_to_balloon_pfn(page) + i); >>>> } >>>> +static int add_one_sg(struct virtqueue *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); >>>> +} >>>>...
2017 Dec 19
0
[PATCH v20 4/7] virtio-balloon: VIRTIO_BALLOON_F_SG
...9 @@ static void set_page_pfns(struct virtio_balloon *vb, page_to_balloon_pfn(page) + i); } +static void kick_and_wait(struct virtqueue *vq, wait_queue_head_t wq_head) +{ + unsigned int len; + + virtqueue_kick(vq); + wait_event(wq_head, virtqueue_get_buf(vq, &len)); +} + +static void add_one_sg(struct virtqueue *vq, unsigned long pfn, uint32_t len) +{ + struct scatterlist sg; + unsigned int unused; + int err; + + sg_init_table(&sg, 1); + sg_set_page(&sg, pfn_to_page(pfn), len, 0); + + /* Detach all the used buffers from the vq */ + while (virtqueue_get_buf(vq, &unused)) + ; +...
2018 Jan 09
0
[PATCH v21 2/5 RESEND] virtio-balloon: VIRTIO_BALLOON_F_SG
...8 @@ static void set_page_pfns(struct virtio_balloon *vb, page_to_balloon_pfn(page) + i); } +static void kick_and_wait(struct virtqueue *vq, wait_queue_head_t wq_head) +{ + unsigned int len; + + virtqueue_kick(vq); + wait_event(wq_head, virtqueue_get_buf(vq, &len)); +} + +static void add_one_sg(struct virtqueue *vq, unsigned long pfn, uint32_t len) +{ + struct scatterlist sg; + unsigned int unused; + int err; + + sg_init_table(&sg, 1); + sg_set_page(&sg, pfn_to_page(pfn), len, 0); + + /* Detach all the used buffers from the vq */ + while (virtqueue_get_buf(vq, &unused)) + ; +...
2018 Jan 18
0
[PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
On Thu, Jan 18, 2018 at 10:30:18PM +0900, Tetsuo Handa wrote: > On 2018/01/18 1:44, Michael S. Tsirkin wrote: > >> +static void add_one_sg(struct virtqueue *vq, unsigned long pfn, uint32_t len) > >> +{ > >> + struct scatterlist sg; > >> + unsigned int unused; > >> + int err; > >> + > >> + sg_init_table(&sg, 1); > >> + sg_set_page(&sg, pfn_to_page(pfn), len, 0); &gt...
2018 Jan 18
0
[PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
On Fri, Jan 19, 2018 at 06:11:31AM +0900, Tetsuo Handa wrote: > Michael S. Tsirkin wrote: > > On Thu, Jan 18, 2018 at 10:30:18PM +0900, Tetsuo Handa wrote: > > > On 2018/01/18 1:44, Michael S. Tsirkin wrote: > > > >> +static void add_one_sg(struct virtqueue *vq, unsigned long pfn, uint32_t len) > > > >> +{ > > > >> + struct scatterlist sg; > > > >> + unsigned int unused; > > > >> + int err; > > > >> + > > > >> + sg_init_table(&sg, 1); > &g...
2018 Apr 04
0
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
On 04/04/2018 02:47 AM, Michael S. Tsirkin wrote: > On Wed, Apr 04, 2018 at 12:10:03AM +0800, Wei Wang wrote: >> +static int add_one_sg(struct virtqueue *vq, unsigned long pfn, uint32_t len) >> +{ >> + struct scatterlist sg; >> + unsigned int unused; >> + >> + sg_init_table(&sg, 1); >> + sg_set_page(&sg, pfn_to_page(pfn), len, 0); >> + >> + /* Detach all the used buffers from...
2018 Jan 17
8
[PATCH v22 0/3] Virtio-balloon: support free page reporting
...sfer of guest free pages in the 1st round. It is not concerned that the memory pages are used after they are given to the hypervisor as a hint of the free pages, because they will be tracked by the hypervisor and transferred in the next round if they are used and written. ChangeLog: v21-v22: - add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For precious ChangeLog, please reference https://lwn.net/Articles/743660/ Wei Wang (3): mm: support reporting free page blocks virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ virtio-balloon: don't report free pag...
2018 Jan 17
8
[PATCH v22 0/3] Virtio-balloon: support free page reporting
...sfer of guest free pages in the 1st round. It is not concerned that the memory pages are used after they are given to the hypervisor as a hint of the free pages, because they will be tracked by the hypervisor and transferred in the next round if they are used and written. ChangeLog: v21-v22: - add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For precious ChangeLog, please reference https://lwn.net/Articles/743660/ Wei Wang (3): mm: support reporting free page blocks virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ virtio-balloon: don't report free pag...
2018 Feb 01
0
[PATCH v25 0/2] Virtio-balloon: support free page reporting
...gt;balloon_wq in probe(), if null, bail out > - add a new feature bit for page poisoning > - solve the corner case that one cmd id being sent to host twice > v22->v23: > - change to kick the device when the vq is half-way full; > - open-code batch_free_page_sg into add_one_sg; > - change cmd_id from "uint32_t" to "__virtio32"; > - reserver one entry in the vq for teh driver to send cmd_id, instead > of busywaiting for an available entry; > - add "stop_update" check before queue_work for prudence purpose for &gt...
2018 Apr 04
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
On Wed, Apr 04, 2018 at 10:07:51AM +0800, Wei Wang wrote: > On 04/04/2018 02:47 AM, Michael S. Tsirkin wrote: > > On Wed, Apr 04, 2018 at 12:10:03AM +0800, Wei Wang wrote: > > > +static int add_one_sg(struct virtqueue *vq, unsigned long pfn, uint32_t len) > > > +{ > > > + struct scatterlist sg; > > > + unsigned int unused; > > > + > > > + sg_init_table(&sg, 1); > > > + sg_set_page(&sg, pfn_to_page(pfn), len, 0); > > > + >...
2018 Apr 04
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
On Wed, Apr 04, 2018 at 10:07:51AM +0800, Wei Wang wrote: > On 04/04/2018 02:47 AM, Michael S. Tsirkin wrote: > > On Wed, Apr 04, 2018 at 12:10:03AM +0800, Wei Wang wrote: > > > +static int add_one_sg(struct virtqueue *vq, unsigned long pfn, uint32_t len) > > > +{ > > > + struct scatterlist sg; > > > + unsigned int unused; > > > + > > > + sg_init_table(&sg, 1); > > > + sg_set_page(&sg, pfn_to_page(pfn), len, 0); > > > + >...