search for: virtio_balloon_send_free_pag

Displaying 20 results from an estimated 98 matches for "virtio_balloon_send_free_pag".

2018 Jan 25
2
[PATCH v24 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...p;vb->stop_update_lock, flags); >> + vb->start_cmd_id = cpu_to_virtio32(vb->vdev, >> + VIRTIO_BALLOON_FREE_PAGE_REPORT_STOP_ID); >> + spin_unlock_irqrestore(&vb->stop_update_lock, flags); >> + >> + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); >> Can you teach walk_free_mem_block to return the && of all >> return calls, so caller knows whether it completed? > > There will be two cases that can cause walk_free_mem_block to return without completing: > 1) host requests to stop in advance > 2) vq->bro...
2017 Dec 01
3
[PATCH v18 10/10] virtio-balloon: don't report free pages when page poisoning is enabled
...d report_free_page(struct work_struct *work) > /* Start by sending the obtained cmd id to the host with an outbuf */ > send_one_desc(vb, vb->free_page_vq, virt_to_phys(&vb->start_cmd_id), > sizeof(uint32_t), false, true, false); > - walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > + if (!(page_poisoning_enabled() && > + !IS_ENABLED(CONFIG_PAGE_POISONING_NO_SANITY))) > + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > /* > * End by sending the stop id to the host with an outbuf. Use the > * non-batching mode here...
2017 Dec 01
3
[PATCH v18 10/10] virtio-balloon: don't report free pages when page poisoning is enabled
...d report_free_page(struct work_struct *work) > /* Start by sending the obtained cmd id to the host with an outbuf */ > send_one_desc(vb, vb->free_page_vq, virt_to_phys(&vb->start_cmd_id), > sizeof(uint32_t), false, true, false); > - walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > + if (!(page_poisoning_enabled() && > + !IS_ENABLED(CONFIG_PAGE_POISONING_NO_SANITY))) > + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > /* > * End by sending the stop id to the host with an outbuf. Use the > * non-batching mode here...
2017 Nov 17
3
[virtio-dev] Re: [PATCH v17 6/6] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...ruct work_struct *work) >>> +{ >>> + struct virtio_balloon *vb; >>> + >>> + vb = container_of(work, struct virtio_balloon, >>> report_free_page_work); >>> + report_free_page_cmd_id(vb); >>> + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); >>> + /* >>> + * The last few free page blocks that were added may not reach the >>> + * batch size, but need a kick to notify the device to handle >>> them. >>> + */ >>> + virtqueue_kick(vb->free_page_vq); >>>...
2017 Nov 17
3
[virtio-dev] Re: [PATCH v17 6/6] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...ruct work_struct *work) >>> +{ >>> + struct virtio_balloon *vb; >>> + >>> + vb = container_of(work, struct virtio_balloon, >>> report_free_page_work); >>> + report_free_page_cmd_id(vb); >>> + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); >>> + /* >>> + * The last few free page blocks that were added may not reach the >>> + * batch size, but need a kick to notify the device to handle >>> them. >>> + */ >>> + virtqueue_kick(vb->free_page_vq); >>>...
2017 Dec 11
1
[PATCH v18 10/10] virtio-balloon: don't report free pages when page poisoning is enabled
...) > > > /* Start by sending the obtained cmd id to the host with an outbuf */ > > > send_one_desc(vb, vb->free_page_vq, virt_to_phys(&vb->start_cmd_id), > > > sizeof(uint32_t), false, true, false); > > > - walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > > > + if (!(page_poisoning_enabled() && > > > + !IS_ENABLED(CONFIG_PAGE_POISONING_NO_SANITY))) > > > + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > > > /* > > > * End by sending the stop id to the host with...
2017 Dec 11
1
[PATCH v18 10/10] virtio-balloon: don't report free pages when page poisoning is enabled
...) > > > /* Start by sending the obtained cmd id to the host with an outbuf */ > > > send_one_desc(vb, vb->free_page_vq, virt_to_phys(&vb->start_cmd_id), > > > sizeof(uint32_t), false, true, false); > > > - walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > > > + if (!(page_poisoning_enabled() && > > > + !IS_ENABLED(CONFIG_PAGE_POISONING_NO_SANITY))) > > > + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > > > /* > > > * End by sending the stop id to the host with...
2018 Jan 24
3
[PATCH v24 2/2] 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_ID_FREE_PAGE]; > + > return 0; > } > > +static bool virtio_balloon_send_free_pages(void *opaque, unsigned long pfn, > + unsigned long nr_pages) > +{ > + struct virtio_balloon *vb = (struct virtio_balloon *)opaque; > + uint32_t len = nr_pages << PAGE_SHIFT; > + int ret; > + > + if (!vb->report_free_page || > + unlikely(!virtio_has_feat...
2018 Jan 24
3
[PATCH v24 2/2] 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_ID_FREE_PAGE]; > + > return 0; > } > > +static bool virtio_balloon_send_free_pages(void *opaque, unsigned long pfn, > + unsigned long nr_pages) > +{ > + struct virtio_balloon *vb = (struct virtio_balloon *)opaque; > + uint32_t len = nr_pages << PAGE_SHIFT; > + int ret; > + > + if (!vb->report_free_page || > + unlikely(!virtio_has_feat...
2017 Nov 18
1
[virtio-dev] Re: [PATCH v17 6/6] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...truct virtio_balloon *vb; > > > > > + > > > > > + vb = container_of(work, struct virtio_balloon, > > > > > report_free_page_work); > > > > > + report_free_page_cmd_id(vb); > > > > > + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > > > > > + /* > > > > > + * The last few free page blocks that were added may not reach the > > > > > + * batch size, but need a kick to notify the device to > > > > > handle them. > > > > > + */ > &gt...
2017 Nov 18
1
[virtio-dev] Re: [PATCH v17 6/6] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...truct virtio_balloon *vb; > > > > > + > > > > > + vb = container_of(work, struct virtio_balloon, > > > > > report_free_page_work); > > > > > + report_free_page_cmd_id(vb); > > > > > + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > > > > > + /* > > > > > + * The last few free page blocks that were added may not reach the > > > > > + * batch size, but need a kick to notify the device to > > > > > handle them. > > > > > + */ > &gt...
2017 Nov 29
0
[PATCH v18 10/10] virtio-balloon: don't report free pages when page poisoning is enabled
...+652,9 @@ static void report_free_page(struct work_struct *work) /* Start by sending the obtained cmd id to the host with an outbuf */ send_one_desc(vb, vb->free_page_vq, virt_to_phys(&vb->start_cmd_id), sizeof(uint32_t), false, true, false); - walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); + if (!(page_poisoning_enabled() && + !IS_ENABLED(CONFIG_PAGE_POISONING_NO_SANITY))) + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); /* * End by sending the stop id to the host with an outbuf. Use the * non-batching mode here to trigger a kick after addin...
2018 Jan 25
0
[PATCH v24 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
.... > + */ > + spin_lock_irqsave(&vb->stop_update_lock, flags); > + vb->start_cmd_id = cpu_to_virtio32(vb->vdev, > + VIRTIO_BALLOON_FREE_PAGE_REPORT_STOP_ID); > + spin_unlock_irqrestore(&vb->stop_update_lock, flags); > + > + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > Can you teach walk_free_mem_block to return the && of all > return calls, so caller knows whether it completed? There will be two cases that can cause walk_free_mem_block to return without completing: 1) host requests to stop in advance 2) vq->broken How about letting walk...
2017 Dec 11
0
[PATCH v18 10/10] virtio-balloon: don't report free pages when page poisoning is enabled
...struct work_struct *work) >> /* Start by sending the obtained cmd id to the host with an outbuf */ >> send_one_desc(vb, vb->free_page_vq, virt_to_phys(&vb->start_cmd_id), >> sizeof(uint32_t), false, true, false); >> - walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); >> + if (!(page_poisoning_enabled() && >> + !IS_ENABLED(CONFIG_PAGE_POISONING_NO_SANITY))) >> + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); >> /* >> * End by sending the stop id to the host with an outbuf. Use the >>...
2017 Nov 15
3
[PATCH v17 6/6] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...ne s64 towards_target(struct virtio_balloon *vb) > { > s64 target; > @@ -597,42 +673,147 @@ static void update_balloon_size_func(struct work_struct *work) > queue_work(system_freezable_wq, work); > } > > -static int init_vqs(struct virtio_balloon *vb) > +static bool virtio_balloon_send_free_pages(void *opaque, unsigned long pfn, > + unsigned long nr_pages) > { > - struct virtqueue *vqs[3]; > - vq_callback_t *callbacks[] = { balloon_ack, balloon_ack, stats_request }; > - static const char * const names[] = { "inflate", "deflate", "stats"...
2017 Nov 15
3
[PATCH v17 6/6] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...ne s64 towards_target(struct virtio_balloon *vb) > { > s64 target; > @@ -597,42 +673,147 @@ static void update_balloon_size_func(struct work_struct *work) > queue_work(system_freezable_wq, work); > } > > -static int init_vqs(struct virtio_balloon *vb) > +static bool virtio_balloon_send_free_pages(void *opaque, unsigned long pfn, > + unsigned long nr_pages) > { > - struct virtqueue *vqs[3]; > - vq_callback_t *callbacks[] = { balloon_ack, balloon_ack, stats_request }; > - static const char * const names[] = { "inflate", "deflate", "stats"...
2017 Nov 17
0
[virtio-dev] Re: [PATCH v17 6/6] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...gt; > > > + struct virtio_balloon *vb; > > > > + > > > > + vb = container_of(work, struct virtio_balloon, > > > > report_free_page_work); > > > > + report_free_page_cmd_id(vb); > > > > + walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); > > > > + /* > > > > + * The last few free page blocks that were added may not reach the > > > > + * batch size, but need a kick to notify the device to > > > > handle them. > > > > + */ > > > > + virtqueu...
2018 Jun 12
2
[PULL] vhost: cleanups and fixes
...call chain. But then when I started looking at the whole dma_map_page() thing, it just raised my hackles again. I would seriously suggest having a much simpler version for the "no allocation, no dma mapping" case, so that it's *obvious* that that never happens. So instead of having virtio_balloon_send_free_pages() call a really generic complex chain of functions that in _some_ cases can do memory allocation, why isn't there a short-circuited "vitruque_add_datum()" that is guaranteed to never do anything like that? Honestly, I look at "add_one_sg()" and it really doesn't make...
2018 Jun 12
2
[PULL] vhost: cleanups and fixes
...call chain. But then when I started looking at the whole dma_map_page() thing, it just raised my hackles again. I would seriously suggest having a much simpler version for the "no allocation, no dma mapping" case, so that it's *obvious* that that never happens. So instead of having virtio_balloon_send_free_pages() call a really generic complex chain of functions that in _some_ cases can do memory allocation, why isn't there a short-circuited "vitruque_add_datum()" that is guaranteed to never do anything like that? Honestly, I look at "add_one_sg()" and it really doesn't make...
2018 Jan 25
2
[PATCH v25 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...*/ > + if (vq->num_free > 1) > + ret = virtqueue_add_inbuf(vq, &sg, 1, vq, GFP_KERNEL); > + > + if (vq->num_free == virtqueue_get_vring_size(vq) / 2 || > + vq->num_free <= 2) > + virtqueue_kick(vq); > + > + return ret; > +} > + > +static int virtio_balloon_send_free_pages(void *opaque, unsigned long pfn, > + unsigned long nr_pages) > +{ > + struct virtio_balloon *vb = (struct virtio_balloon *)opaque; > + uint32_t len = nr_pages << PAGE_SHIFT; > + > + /* > + * If a stop id or a new cmd id was just received from host, stop > +...