search for: balloon_pfn_to_page

Displaying 20 results from an estimated 50 matches for "balloon_pfn_to_page".

2016 Oct 21
0
[RESEND PATCH v3 kernel 1/7] virtio-balloon: rework deflate to add page to a list
Will allow faster notifications using a bitmap down the road. balloon_pfn_to_page() can be removed because it's useless. Signed-off-by: Liang Li <liang.z.li at intel.com> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> Cc: Paolo Bonzini <pbonzini at redhat.com> Cc: Cornelia Huck <cornelia.huck at de.ibm.com> Cc: Amit Shah <amit.shah at redha...
2013 May 26
6
[PATCH v8, part3 12/14] mm: correctly update zone->mamaged_pages
..._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 = balloon_pfn_to_page(pfns[i]); + balloon_page_free(page); + adjust_managed_page_count(page, 1); } } diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 930fb68..c8aab4e 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -89...
2013 May 26
6
[PATCH v8, part3 12/14] mm: correctly update zone->mamaged_pages
..._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 = balloon_pfn_to_page(pfns[i]); + balloon_page_free(page); + adjust_managed_page_count(page, 1); } } diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 930fb68..c8aab4e 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -89...
2013 May 26
6
[PATCH v8, part3 12/14] mm: correctly update zone->mamaged_pages
..._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 = balloon_pfn_to_page(pfns[i]); + balloon_page_free(page); + adjust_managed_page_count(page, 1); } } diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 930fb68..c8aab4e 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -89...
2016 May 18
4
[PATCH] virtio_balloon: fix PFN format for virtio-1
...on *vb, size_t num) static void release_pages_balloon(struct virtio_balloon *vb) { unsigned int i; + struct page *page; /* Find pfns pointing at start of each page, get pages and free them. */ for (i = 0; i < vb->num_pfns; i += VIRTIO_BALLOON_PAGES_PER_PAGE) { - struct page *page = balloon_pfn_to_page(vb->pfns[i]); + page = balloon_pfn_to_page(virtio32_to_cpu(vb->vdev, + vb->pfns[i])); if (!virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) adjust_managed_page_count(page, 1); @@ -203,7 +207,7 @@ static unsigned leak_balloon(struct virtio_balloon *vb...
2016 May 18
4
[PATCH] virtio_balloon: fix PFN format for virtio-1
...on *vb, size_t num) static void release_pages_balloon(struct virtio_balloon *vb) { unsigned int i; + struct page *page; /* Find pfns pointing at start of each page, get pages and free them. */ for (i = 0; i < vb->num_pfns; i += VIRTIO_BALLOON_PAGES_PER_PAGE) { - struct page *page = balloon_pfn_to_page(vb->pfns[i]); + page = balloon_pfn_to_page(virtio32_to_cpu(vb->vdev, + vb->pfns[i])); if (!virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) adjust_managed_page_count(page, 1); @@ -203,7 +207,7 @@ static unsigned leak_balloon(struct virtio_balloon *vb...
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 Oct 24
1
[RESEND PATCH v3 kernel 1/7] virtio-balloon: rework deflate to add page to a list
On 10/20/2016 11:24 PM, Liang Li wrote: > Will allow faster notifications using a bitmap down the road. > balloon_pfn_to_page() can be removed because it's useless. This is a pretty terse description of what's going on here. Could you try to elaborate a bit? What *is* the current approach? Why does it not work going forward? What do you propose instead? Why is it better?
2016 Oct 24
1
[RESEND PATCH v3 kernel 1/7] virtio-balloon: rework deflate to add page to a list
On 10/20/2016 11:24 PM, Liang Li wrote: > Will allow faster notifications using a bitmap down the road. > balloon_pfn_to_page() can be removed because it's useless. This is a pretty terse description of what's going on here. Could you try to elaborate a bit? What *is* the current approach? Why does it not work going forward? What do you propose instead? Why is it better?
2016 Jun 13
0
[PATCH] virtio_balloon: fix PFN format for virtio-1
...lease_pages_balloon(struct virtio_balloon *vb) > { > unsigned int i; > + struct page *page; > > /* Find pfns pointing at start of each page, get pages and free them. */ > for (i = 0; i < vb->num_pfns; i += VIRTIO_BALLOON_PAGES_PER_PAGE) { > - struct page *page = balloon_pfn_to_page(vb->pfns[i]); > + page = balloon_pfn_to_page(virtio32_to_cpu(vb->vdev, > + vb->pfns[i])); > if (!virtio_has_feature(vb->vdev, > VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) > adjust_managed_page_count(page, 1); > @@ -203,7 +207,7 @@ static unsigned leak_bal...
2012 Apr 13
0
[PATCH] virtio_balloon: fix handling of PAGE_SIZE != 4k
...unsigned long pfn = page_to_pfn(page); BUILD_BUG_ON(PAGE_SHIFT < VIRTIO_BALLOON_PFN_SHIFT); /* Convert pfn from Linux page size to balloon page size. */ - return pfn >> (PAGE_SHIFT - VIRTIO_BALLOON_PFN_SHIFT); + return pfn * VIRTIO_BALLOON_PAGES_PER_PAGE; +} + +static struct page *balloon_pfn_to_page(u32 pfn) +{ + BUG_ON(pfn % VIRTIO_BALLOON_PAGES_PER_PAGE); + return pfn_to_page(pfn / VIRTIO_BALLOON_PAGES_PER_PAGE); } static void balloon_ack(struct virtqueue *vq) @@ -96,12 +109,23 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) wait_for_completion(&vb->ack...
2012 Apr 13
0
[PATCH] virtio_balloon: fix handling of PAGE_SIZE != 4k
...unsigned long pfn = page_to_pfn(page); BUILD_BUG_ON(PAGE_SHIFT < VIRTIO_BALLOON_PFN_SHIFT); /* Convert pfn from Linux page size to balloon page size. */ - return pfn >> (PAGE_SHIFT - VIRTIO_BALLOON_PFN_SHIFT); + return pfn * VIRTIO_BALLOON_PAGES_PER_PAGE; +} + +static struct page *balloon_pfn_to_page(u32 pfn) +{ + BUG_ON(pfn % VIRTIO_BALLOON_PAGES_PER_PAGE); + return pfn_to_page(pfn / VIRTIO_BALLOON_PAGES_PER_PAGE); } static void balloon_ack(struct virtqueue *vq) @@ -96,12 +109,23 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) wait_for_completion(&vb->ack...
2013 May 11
0
[PATCH v6, part3 13/16] mm: correctly update zone->mamaged_pages
..._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 = balloon_pfn_to_page(pfns[i]); + balloon_page_free(page); + adjust_managed_page_count(page, 1); } } diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index d42da3b..a453c05 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -89...
2013 May 11
0
[PATCH v6, part3 13/16] mm: correctly update zone->mamaged_pages
..._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 = balloon_pfn_to_page(pfns[i]); + balloon_page_free(page); + adjust_managed_page_count(page, 1); } } diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index d42da3b..a453c05 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -89...
2013 May 11
0
[PATCH v6, part3 13/16] mm: correctly update zone->mamaged_pages
..._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 = balloon_pfn_to_page(pfns[i]); + balloon_page_free(page); + adjust_managed_page_count(page, 1); } } diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index d42da3b..a453c05 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -89...
2016 Jun 29
11
[PATCH v2 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration
This patch set contains two parts of changes 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 about 85%.
2016 Jun 29
11
[PATCH v2 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration
This patch set contains two parts of changes 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 about 85%.
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...n, offset, size; + struct page *page; + + size = min(vb->bmap_len * BITS_PER_BYTE, vb->end_pfn); + for (offset = vb->start_pfn; offset < size; + offset = pfn + VIRTIO_BALLOON_PAGES_PER_PAGE) { + pfn = find_next_bit(vb->page_bitmap, size, offset); + if (pfn < size) { + page = balloon_pfn_to_page(pfn); + if (!virtio_has_feature(vb->vdev, + VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) + adjust_managed_page_count(page, 1); + put_page(page); + } + } +} + +static unsigned long leak_balloon_bitmap(struct virtio_balloon *vb, size_t num) +{ + unsigned long num_freed_pages = num; + struct page...
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...n, offset, size; + struct page *page; + + size = min(vb->bmap_len * BITS_PER_BYTE, vb->end_pfn); + for (offset = vb->start_pfn; offset < size; + offset = pfn + VIRTIO_BALLOON_PAGES_PER_PAGE) { + pfn = find_next_bit(vb->page_bitmap, size, offset); + if (pfn < size) { + page = balloon_pfn_to_page(pfn); + if (!virtio_has_feature(vb->vdev, + VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) + adjust_managed_page_count(page, 1); + put_page(page); + } + } +} + +static unsigned long leak_balloon_bitmap(struct virtio_balloon *vb, size_t num) +{ + unsigned long num_freed_pages = num; + struct page...