search for: release_pages_balloon

Displaying 20 results from an estimated 127 matches for "release_pages_balloon".

2016 Oct 21
0
[RESEND PATCH v3 kernel 1/7] virtio-balloon: rework deflate to add page to a list
...turn pfn_to_page(pfn / VIRTIO_BALLOON_PAGES_PER_PAGE); -} - static void balloon_ack(struct virtqueue *vq) { struct virtio_balloon *vb = vq->vdev->priv; @@ -181,18 +175,16 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) return num_allocated_pages; } -static void release_pages_balloon(struct virtio_balloon *vb) +static void release_pages_balloon(struct virtio_balloon *vb, + struct list_head *pages) { - unsigned int i; - struct page *page; + struct page *page, *next; - /* Find pfns pointing at start of each page, get pages and free them. */ - for (i = 0; i < vb->num_...
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.
2016 May 25
2
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...t > } > That means we have to allocate/free all the requested pages first, and then tell the host. It works fine for inflating, but for deflating, because the page has been deleted from the vb-> vb_dev_info->pages, so, we have to use a struct to save the dequeued pages before calling release_pages_balloon(), I think a page bitmap is the best struct to save these pages, because it consumes less memory. And that bitmap should be large enough to save pfn 0 to max_pfn. If the above is true, then we are back to the square one. we really need a large page bitmap. Right? Liang
2016 May 25
2
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...t > } > That means we have to allocate/free all the requested pages first, and then tell the host. It works fine for inflating, but for deflating, because the page has been deleted from the vb-> vb_dev_info->pages, so, we have to use a struct to save the dequeued pages before calling release_pages_balloon(), I think a page bitmap is the best struct to save these pages, because it consumes less memory. And that bitmap should be large enough to save pfn 0 to max_pfn. If the above is true, then we are back to the square one. we really need a large page bitmap. Right? Liang
2015 Dec 27
5
[PATCH 1/2] virtio_balloon: fix race by fill and leak
During my compaction-related stuff, I encountered a bug with ballooning. With repeated inflating and deflating cycle, guest memory( ie, cat /proc/meminfo | grep MemTotal) is decreased and couldn't be recovered. The reason is balloon_lock doesn't cover release_pages_balloon so struct virtio_balloon fields could be overwritten by race of fill_balloon(e,g, vb->*pfns could be critical). This patch fixes it in my test. Cc: <stable at vger.kernel.org> Signed-off-by: Minchan Kim <minchan at kernel.org> --- drivers/virtio/virtio_balloon.c | 2 +- 1 file cha...
2015 Dec 27
5
[PATCH 1/2] virtio_balloon: fix race by fill and leak
During my compaction-related stuff, I encountered a bug with ballooning. With repeated inflating and deflating cycle, guest memory( ie, cat /proc/meminfo | grep MemTotal) is decreased and couldn't be recovered. The reason is balloon_lock doesn't cover release_pages_balloon so struct virtio_balloon fields could be overwritten by race of fill_balloon(e,g, vb->*pfns could be critical). This patch fixes it in my test. Cc: <stable at vger.kernel.org> Signed-off-by: Minchan Kim <minchan at kernel.org> --- drivers/virtio/virtio_balloon.c | 2 +- 1 file cha...
2017 Oct 22
2
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...; > + atomic64_add(num_pfns, &vb->num_pages); Isn't this addition too late? If leak_balloon() is called due to out_of_memory(), it will fail to find up to dated vb->num_pages value. > > - return num_allocated_pages; > + return num_pfns; > } > > static void release_pages_balloon(struct virtio_balloon *vb, > @@ -194,38 +192,39 @@ static void release_pages_balloon(struct virtio_balloon *vb, > > static unsigned leak_balloon(struct virtio_balloon *vb, size_t num) > { > - unsigned num_freed_pages; > struct page *page; > struct balloon_dev_info *vb_d...
2017 Oct 22
2
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...; > + atomic64_add(num_pfns, &vb->num_pages); Isn't this addition too late? If leak_balloon() is called due to out_of_memory(), it will fail to find up to dated vb->num_pages value. > > - return num_allocated_pages; > + return num_pfns; > } > > static void release_pages_balloon(struct virtio_balloon *vb, > @@ -194,38 +192,39 @@ static void release_pages_balloon(struct virtio_balloon *vb, > > static unsigned leak_balloon(struct virtio_balloon *vb, size_t num) > { > - unsigned num_freed_pages; > struct page *page; > struct balloon_dev_info *vb_d...
2015 Dec 27
0
[PATCH 1/2] virtio_balloon: fix race by fill and leak
...t; During my compaction-related stuff, I encountered a bug > with ballooning. > > With repeated inflating and deflating cycle, guest memory( > ie, cat /proc/meminfo | grep MemTotal) is decreased and > couldn't be recovered. > > The reason is balloon_lock doesn't cover release_pages_balloon > so struct virtio_balloon fields could be overwritten by race > of fill_balloon(e,g, vb->*pfns could be critical). > > This patch fixes it in my test. > > Cc: <stable at vger.kernel.org> > Signed-off-by: Minchan Kim <minchan at kernel.org> > --- > drive...
2017 Oct 20
0
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...vb, vb->inflate_vq); - mutex_unlock(&vb->balloon_lock); + if (num_pfns != 0) + tell_host(vb, vb->inflate_vq, pfns, num_pfns); + mutex_unlock(&vb->inflate_lock); + atomic64_add(num_pfns, &vb->num_pages); - return num_allocated_pages; + return num_pfns; } static void release_pages_balloon(struct virtio_balloon *vb, @@ -194,38 +192,39 @@ static void release_pages_balloon(struct virtio_balloon *vb, 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;...
2016 Oct 25
1
[RESEND PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...; + if (use_bmap) > + set_page_bitmap(vb, &vb_dev_info->pages, > + vb->inflate_vq); > + else > + tell_host(vb, vb->inflate_vq); > + } > mutex_unlock(&vb->balloon_lock); > > return num_allocated_pages; > @@ -189,15 +338,19 @@ static void release_pages_balloon(struct virtio_balloon *vb, > } > } > > -static unsigned leak_balloon(struct virtio_balloon *vb, size_t num) > +static unsigned int leak_balloon(struct virtio_balloon *vb, size_t num, > + bool use_bmap) this is just a feature bit - why not get it internally? > { >...
2016 Oct 25
1
[RESEND PATCH v3 kernel 4/7] virtio-balloon: speed up inflate/deflate process
...; + if (use_bmap) > + set_page_bitmap(vb, &vb_dev_info->pages, > + vb->inflate_vq); > + else > + tell_host(vb, vb->inflate_vq); > + } > mutex_unlock(&vb->balloon_lock); > > return num_allocated_pages; > @@ -189,15 +338,19 @@ static void release_pages_balloon(struct virtio_balloon *vb, > } > } > > -static unsigned leak_balloon(struct virtio_balloon *vb, size_t num) > +static unsigned int leak_balloon(struct virtio_balloon *vb, size_t num, > + bool use_bmap) this is just a feature bit - why not get it internally? > { >...
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...ned fill_balloon_pfns(struct virtio_balloon *vb, size_t num) { struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info; unsigned num_allocated_pages; @@ -174,7 +244,104 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) return num_allocated_pages; } -static void release_pages_balloon(struct virtio_balloon *vb) +static long fill_balloon_bitmap(struct virtio_balloon *vb, size_t num) +{ + struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info; + long num_allocated_pages = 0; + + if (balloon_page_bitmap_init(vb) < 0) + return num; + + mutex_lock(&vb->balloon_lock...
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...ned fill_balloon_pfns(struct virtio_balloon *vb, size_t num) { struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info; unsigned num_allocated_pages; @@ -174,7 +244,104 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) return num_allocated_pages; } -static void release_pages_balloon(struct virtio_balloon *vb) +static long fill_balloon_bitmap(struct virtio_balloon *vb, size_t num) +{ + struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info; + long num_allocated_pages = 0; + + if (balloon_page_bitmap_init(vb) < 0) + return num; + + mutex_lock(&vb->balloon_lock...
2016 May 25
0
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...> That means we have to allocate/free all the requested pages first, and then tell the host. > It works fine for inflating, but for deflating, because the page has been deleted from the vb-> vb_dev_info->pages, > so, we have to use a struct to save the dequeued pages before calling release_pages_balloon(), struct list_head? I think you can just replace set_page_pfns with list_add(&page->lru, &page_list); > I think a page bitmap is the best struct to save these pages, because it consumes less memory. > And that bitmap should be large enough to save pfn 0 to max_pfn. &...
2016 May 24
4
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info; > > unsigned num_allocated_pages; > > @@ -174,7 +244,104 @@ static unsigned fill_balloon(struct virtio_balloon > *vb, size_t num) > > return num_allocated_pages; > > } > > > > -static void release_pages_balloon(struct virtio_balloon *vb) > > +static long fill_balloon_bitmap(struct virtio_balloon *vb, size_t > > +num) { > > + struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info; > > + long num_allocated_pages = 0; > > + > > + if (balloon_page_bitmap_init(vb) &l...
2016 May 24
4
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info; > > unsigned num_allocated_pages; > > @@ -174,7 +244,104 @@ static unsigned fill_balloon(struct virtio_balloon > *vb, size_t num) > > return num_allocated_pages; > > } > > > > -static void release_pages_balloon(struct virtio_balloon *vb) > > +static long fill_balloon_bitmap(struct virtio_balloon *vb, size_t > > +num) { > > + struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info; > > + long num_allocated_pages = 0; > > + > > + if (balloon_page_bitmap_init(vb) &l...
2016 Jul 27
14
[PATCH v2 repost 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration
This patchset is for kernel and contains two parts of change to the virtio-balloon. One is the change for speeding up the inflating & deflating process, the main idea of this optimization is to use bitmap to send the page information to host instead of the PFNs, to reduce the overhead of virtio data transmission, address translation and madvise(). This can help to improve the performance by
2016 Jul 27
14
[PATCH v2 repost 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration
This patchset is for kernel and contains two parts of change to the virtio-balloon. One is the change for speeding up the inflating & deflating process, the main idea of this optimization is to use bitmap to send the page information to host instead of the PFNs, to reduce the overhead of virtio data transmission, address translation and madvise(). This can help to improve the performance by