search for: release_pages_by_pfn

Displaying 20 results from an estimated 71 matches for "release_pages_by_pfn".

2011 Jul 02
1
[PATCH] virtio_balloon: Notify guest only after deflating the balloon
...vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST); - * is true, we *have* to do it in this order + * If the host doesn't require us to notify him before using + * pages which belong to the balloon, update him only after + * freeing those pages for guest use. */ - tell_host(vb, vb->deflate_vq); - release_pages_by_pfn(vb->pfns, vb->num_pfns); + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST)) { + tell_host(vb, vb->deflate_vq); + release_pages_by_pfn(vb->pfns, vb->num_pfns); + } else { + release_pages_by_pfn(vb->pfns, vb->num_pfns); + tell_host(vb, vb->deflate_vq);...
2011 Jul 02
1
[PATCH] virtio_balloon: Notify guest only after deflating the balloon
...vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST); - * is true, we *have* to do it in this order + * If the host doesn't require us to notify him before using + * pages which belong to the balloon, update him only after + * freeing those pages for guest use. */ - tell_host(vb, vb->deflate_vq); - release_pages_by_pfn(vb->pfns, vb->num_pfns); + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST)) { + tell_host(vb, vb->deflate_vq); + release_pages_by_pfn(vb->pfns, vb->num_pfns); + } else { + release_pages_by_pfn(vb->pfns, vb->num_pfns); + tell_host(vb, vb->deflate_vq);...
2011 Apr 07
2
[RFC][PATCH] virtio balloon: kill tell-host-first logic
...l tell_host_first; - /* The pages we've told the Host we're not using. */ unsigned int num_pages; struct list_head pages; @@ -151,13 +148,14 @@ static void leak_balloon(struct virtio_b vb->num_pages--; } - if (vb->tell_host_first) { - tell_host(vb, vb->deflate_vq); - release_pages_by_pfn(vb->pfns, vb->num_pfns); - } else { - release_pages_by_pfn(vb->pfns, vb->num_pfns); - tell_host(vb, vb->deflate_vq); - } + + /* + * Note that if + * virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST); + * is true, we *have* to do it in this order + */ + tell_host(vb, vb-...
2011 Apr 07
2
[RFC][PATCH] virtio balloon: kill tell-host-first logic
...l tell_host_first; - /* The pages we've told the Host we're not using. */ unsigned int num_pages; struct list_head pages; @@ -151,13 +148,14 @@ static void leak_balloon(struct virtio_b vb->num_pages--; } - if (vb->tell_host_first) { - tell_host(vb, vb->deflate_vq); - release_pages_by_pfn(vb->pfns, vb->num_pfns); - } else { - release_pages_by_pfn(vb->pfns, vb->num_pfns); - tell_host(vb, vb->deflate_vq); - } + + /* + * Note that if + * virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST); + * is true, we *have* to do it in this order + */ + tell_host(vb, vb-...
2014 Sep 25
2
[PATCH] virtio_balloon: Convert "vballon" kthread into a workqueue
...ns + vb->num_pfns, page); @@ -154,6 +155,9 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num) if (vb->num_pfns != 0) tell_host(vb, vb->inflate_vq); mutex_unlock(&vb->balloon_lock); + + if (!done) + queue_work(vb->wq, &vb->wq_work); } static void release_pages_by_pfn(const u32 pfns[], unsigned int num) @@ -168,20 +172,25 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num) } } -static void leak_balloon(struct virtio_balloon *vb, size_t num) +static void leak_balloon(struct virtio_balloon *vb, size_t diff) { struct page *page; struct...
2014 Sep 25
2
[PATCH] virtio_balloon: Convert "vballon" kthread into a workqueue
...ns + vb->num_pfns, page); @@ -154,6 +155,9 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num) if (vb->num_pfns != 0) tell_host(vb, vb->inflate_vq); mutex_unlock(&vb->balloon_lock); + + if (!done) + queue_work(vb->wq, &vb->wq_work); } static void release_pages_by_pfn(const u32 pfns[], unsigned int num) @@ -168,20 +172,25 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num) } } -static void leak_balloon(struct virtio_balloon *vb, size_t num) +static void leak_balloon(struct virtio_balloon *vb, size_t diff) { struct page *page; struct...
2012 Apr 12
3
[PATCH 0/3] Bugfixes for virtio balloon driver
This series contains one cleanup and two bug fixes for the virtio balloon driver.
2012 Apr 12
3
[PATCH 0/3] Bugfixes for virtio balloon driver
This series contains one cleanup and two bug fixes for the virtio balloon driver.
2014 Oct 15
0
[PATCH 1/2] virtio_balloon: return the amount of freed memory from leak_balloon()
...virtio/virtio_balloon.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index f893148..66cac10 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -168,8 +168,9 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num) } } -static void leak_balloon(struct virtio_balloon *vb, size_t num) +static unsigned leak_balloon(struct virtio_balloon *vb, size_t num) { + unsigned num_freed_pages; struct page *page; struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info;...
2008 Jan 24
2
[PATCH] Fix compile warnings in virtio_balloon
...)) dev_printk(KERN_INFO, &vb->vdev->dev, - "Out of puff! Can't get %u pages\n", + "Out of puff! Can't get %lu pages\n", num); /* Sleep for at least 1/5 of a second before retry. */ msleep(200); @@ -121,7 +121,7 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num) } } -static void leak_balloon(struct virtio_balloon *vb, unsigned int num) +static void leak_balloon(struct virtio_balloon *vb, unsigned long num) { struct page *page;
2008 Jan 24
2
[PATCH] Fix compile warnings in virtio_balloon
...)) dev_printk(KERN_INFO, &vb->vdev->dev, - "Out of puff! Can't get %u pages\n", + "Out of puff! Can't get %lu pages\n", num); /* Sleep for at least 1/5 of a second before retry. */ msleep(200); @@ -121,7 +121,7 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num) } } -static void leak_balloon(struct virtio_balloon *vb, unsigned int num) +static void leak_balloon(struct virtio_balloon *vb, unsigned long num) { struct page *page;
2020 Feb 06
2
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
...ctually mean "never tell host". It means "host will not discard pages in the balloon, you can defer host notification until after use". This was the original implementation: + if (vb->tell_host_first) { + tell_host(vb, vb->deflate_vq); + release_pages_by_pfn(vb->pfns, vb->num_pfns); + } else { + release_pages_by_pfn(vb->pfns, vb->num_pfns); + tell_host(vb, vb->deflate_vq); + } +} I don't know whether completely skipping host notifications when !VIRTIO_BALLOON_F_MUST_TELL_HOST will break any ho...
2020 Feb 06
2
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
...ctually mean "never tell host". It means "host will not discard pages in the balloon, you can defer host notification until after use". This was the original implementation: + if (vb->tell_host_first) { + tell_host(vb, vb->deflate_vq); + release_pages_by_pfn(vb->pfns, vb->num_pfns); + } else { + release_pages_by_pfn(vb->pfns, vb->num_pfns); + tell_host(vb, vb->deflate_vq); + } +} I don't know whether completely skipping host notifications when !VIRTIO_BALLOON_F_MUST_TELL_HOST will break any ho...
2013 May 28
2
[PATCH] virtio-balloon spec: rework VIRTIO_BALLOON_F_MUST_TELL_HOST feature, support silent deflation
...f - * virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST); - * is true, we *have* to do it in this order - */ - tell_host(vb, vb->deflate_vq); + if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_SILENT_DEFLATE) + tell_host(vb, vb->deflate_vq); mutex_unlock(&vb->balloon_lock); release_pages_by_pfn(vb->pfns, vb->num_pfns); } @@ -543,6 +539,7 @@ static int virtballoon_restore(struct virtio_device *vdev) static unsigned int features[] = { VIRTIO_BALLOON_F_MUST_TELL_HOST, VIRTIO_BALLOON_F_STATS_VQ, + VIRTIO_BALLOON_F_SILENT_DEFLATE, }; static struct virtio_driver virtio_balloon_d...
2015 Aug 19
2
[PATCH 0/2] virtio_balloon: do not change memory amount visible via /proc/meminfo
Though there is a problem in this setup. The end-user and hosting provider have signed SLA agreement in which some amount of memory is guaranted for the guest. The good thing is that this memory will be given to the guest when the guest will really need it (f.e. with OOM in guest and with VIRTIO_BALLOON_F_DEFLATE_ON_OOM configuration flag set). The bad thing is that end-user does not know this.
2015 Aug 19
2
[PATCH 0/2] virtio_balloon: do not change memory amount visible via /proc/meminfo
Though there is a problem in this setup. The end-user and hosting provider have signed SLA agreement in which some amount of memory is guaranted for the guest. The good thing is that this memory will be given to the guest when the guest will really need it (f.e. with OOM in guest and with VIRTIO_BALLOON_F_DEFLATE_ON_OOM configuration flag set). The bad thing is that end-user does not know this.
2013 May 26
6
[PATCH v8, part3 12/14] mm: correctly update zone->mamaged_pages
...set_page_pfns(vb->pfns + vb->num_pfns, page); vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE; - totalram_pages--; + adjust_managed_page_count(page, -1); } /* Did we get any? */ @@ -160,11 +160,13 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num) static void release_pages_by_pfn(const u32 pfns[], unsigned int num) { unsigned int i; + struct page *page; /* Find pfns pointing at start of each page, get pages and free them. */ for (i = 0; i < num; i += VIRTIO_BALLOON_PAGES_PER_PAGE) { - balloon_page_free(balloon_pfn_to_page(pfns[i])); - totalram_pages++; + page...
2013 May 26
6
[PATCH v8, part3 12/14] mm: correctly update zone->mamaged_pages
...set_page_pfns(vb->pfns + vb->num_pfns, page); vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE; - totalram_pages--; + adjust_managed_page_count(page, -1); } /* Did we get any? */ @@ -160,11 +160,13 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num) static void release_pages_by_pfn(const u32 pfns[], unsigned int num) { unsigned int i; + struct page *page; /* Find pfns pointing at start of each page, get pages and free them. */ for (i = 0; i < num; i += VIRTIO_BALLOON_PAGES_PER_PAGE) { - balloon_page_free(balloon_pfn_to_page(pfns[i])); - totalram_pages++; + page...
2013 May 26
6
[PATCH v8, part3 12/14] mm: correctly update zone->mamaged_pages
...set_page_pfns(vb->pfns + vb->num_pfns, page); vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE; - totalram_pages--; + adjust_managed_page_count(page, -1); } /* Did we get any? */ @@ -160,11 +160,13 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num) static void release_pages_by_pfn(const u32 pfns[], unsigned int num) { unsigned int i; + struct page *page; /* Find pfns pointing at start of each page, get pages and free them. */ for (i = 0; i < num; i += VIRTIO_BALLOON_PAGES_PER_PAGE) { - balloon_page_free(balloon_pfn_to_page(pfns[i])); - totalram_pages++; + page...
2020 Feb 06
0
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
...quot;. It means "host will not discard pages in the > balloon, you can defer host notification until after use". > > This was the original implementation: > > + if (vb->tell_host_first) { > + tell_host(vb, vb->deflate_vq); > + release_pages_by_pfn(vb->pfns, vb->num_pfns); > + } else { > + release_pages_by_pfn(vb->pfns, vb->num_pfns); > + tell_host(vb, vb->deflate_vq); > + } > +} > > I don't know whether completely skipping host notifications > when !VIRTIO_BA...