search for: get_max_pfn

Displaying 20 results from an estimated 55 matches for "get_max_pfn".

2016 Nov 04
2
[PATCH kernel v4 7/7] virtio-balloon: tell host vm's unused page info
..._nr_bmap = 0, i; > + > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_PAGE_BITMAP) && > + vb->nr_page_bmap == 1) > + extend_page_bitmap(vb); > + > + pfn_limit = PFNS_PER_BMAP * vb->nr_page_bmap; > + mutex_lock(&vb->balloon_lock); > + last_pfn = get_max_pfn(); > + > + while (ret) { > + clear_page_bitmap(vb); > + ret = get_unused_pages(pfn, pfn + pfn_limit, vb->page_bitmap, > + PFNS_PER_BMAP, vb->nr_page_bmap); This changed the underlying data structure without changing the way that the structure is populated. This algorithm...
2016 Nov 04
2
[PATCH kernel v4 7/7] virtio-balloon: tell host vm's unused page info
..._nr_bmap = 0, i; > + > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_PAGE_BITMAP) && > + vb->nr_page_bmap == 1) > + extend_page_bitmap(vb); > + > + pfn_limit = PFNS_PER_BMAP * vb->nr_page_bmap; > + mutex_lock(&vb->balloon_lock); > + last_pfn = get_max_pfn(); > + > + while (ret) { > + clear_page_bitmap(vb); > + ret = get_unused_pages(pfn, pfn + pfn_limit, vb->page_bitmap, > + PFNS_PER_BMAP, vb->nr_page_bmap); This changed the underlying data structure without changing the way that the structure is populated. This algorithm...
2016 Jul 27
1
[PATCH v2 repost 3/7] mm: add a function to get the max pfn
...6 insertions(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 8b3e134..7da61ad 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -4517,6 +4517,12 @@ void show_free_areas(unsigned int filter) > show_swap_cache_info(); > } > > +unsigned long get_max_pfn(void) > +{ > + return max_pfn; > +} > +EXPORT_SYMBOL(get_max_pfn); > + This needs a coment that this can change at any time. So it's only good as a hint e.g. for sizing data structures. > static void zoneref_set_zone(struct zone *zone, struct zoneref *zoneref) > { >...
2016 Jul 27
1
[PATCH v2 repost 3/7] mm: add a function to get the max pfn
...6 insertions(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 8b3e134..7da61ad 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -4517,6 +4517,12 @@ void show_free_areas(unsigned int filter) > show_swap_cache_info(); > } > > +unsigned long get_max_pfn(void) > +{ > + return max_pfn; > +} > +EXPORT_SYMBOL(get_max_pfn); > + This needs a coment that this can change at any time. So it's only good as a hint e.g. for sizing data structures. > static void zoneref_set_zone(struct zone *zone, struct zoneref *zoneref) > { >...
2016 Jul 27
4
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
On 07/26/2016 06:23 PM, Liang Li wrote: > + vb->pfn_limit = VIRTIO_BALLOON_PFNS_LIMIT; > + vb->pfn_limit = min(vb->pfn_limit, get_max_pfn()); > + vb->bmap_len = ALIGN(vb->pfn_limit, BITS_PER_LONG) / > + BITS_PER_BYTE + 2 * sizeof(unsigned long); > + hdr_len = sizeof(struct balloon_bmap_hdr); > + vb->bmap_hdr = kzalloc(hdr_len + vb->bmap_len, GFP_KERNEL); This ends up doing a 1MB kmalloc() right? That seems...
2016 Jul 27
4
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
On 07/26/2016 06:23 PM, Liang Li wrote: > + vb->pfn_limit = VIRTIO_BALLOON_PFNS_LIMIT; > + vb->pfn_limit = min(vb->pfn_limit, get_max_pfn()); > + vb->bmap_len = ALIGN(vb->pfn_limit, BITS_PER_LONG) / > + BITS_PER_BYTE + 2 * sizeof(unsigned long); > + hdr_len = sizeof(struct balloon_bmap_hdr); > + vb->bmap_hdr = kzalloc(hdr_len + vb->bmap_len, GFP_KERNEL); This ends up doing a 1MB kmalloc() right? That seems...
2016 Jul 27
1
[PATCH v2 repost 6/7] mm: add the related functions to get free page info
...t; mm/page_alloc.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 46 insertions(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 7da61ad..3ad8b10 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -4523,6 +4523,52 @@ unsigned long get_max_pfn(void) > } > EXPORT_SYMBOL(get_max_pfn); > > +static void mark_free_pages_bitmap(struct zone *zone, unsigned long start_pfn, > + unsigned long end_pfn, unsigned long *bitmap, unsigned long len) > +{ > + unsigned long pfn, flags, page_num; > + unsigned int order, t; > +...
2016 Jul 27
1
[PATCH v2 repost 6/7] mm: add the related functions to get free page info
...t; mm/page_alloc.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 46 insertions(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 7da61ad..3ad8b10 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -4523,6 +4523,52 @@ unsigned long get_max_pfn(void) > } > EXPORT_SYMBOL(get_max_pfn); > > +static void mark_free_pages_bitmap(struct zone *zone, unsigned long start_pfn, > + unsigned long end_pfn, unsigned long *bitmap, unsigned long len) > +{ > + unsigned long pfn, flags, page_num; > + unsigned int order, t; > +...
2016 Oct 21
0
[RESEND PATCH v3 kernel 3/7] mm: add a function to get the max pfn
...b/include/linux/mm.h @@ -1776,6 +1776,7 @@ static inline spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd) extern void free_area_init_node(int nid, unsigned long * zones_size, unsigned long zone_start_pfn, unsigned long *zholes_size); extern void free_initmem(void); +extern unsigned long get_max_pfn(void); /* * Free reserved pages within range [PAGE_ALIGN(start), end & PAGE_MASK) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2b3bf67..e5f63a9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4426,6 +4426,16 @@ void show_free_areas(unsigned int filter) show_swap_cache_info...
2016 Nov 07
3
[PATCH kernel v4 7/7] virtio-balloon: tell host vm's unused page info
...ore, and fall back to listing individual PFNs. This would make sens, for instance in a large zone with very few free order-0 pages left. > It seems the benefit we get for this feature is not as big as that in fast balloon inflating/deflating. >> >> You should not be using get_max_pfn(). Any patch set that continues to use >> it is not likely to be using a proper algorithm. > > Do you have any suggestion about how to avoid it? Yes: get the pfns from the page free lists alone. Don't derive them from the pfn limits of the system or zones.
2016 Nov 07
3
[PATCH kernel v4 7/7] virtio-balloon: tell host vm's unused page info
...ore, and fall back to listing individual PFNs. This would make sens, for instance in a large zone with very few free order-0 pages left. > It seems the benefit we get for this feature is not as big as that in fast balloon inflating/deflating. >> >> You should not be using get_max_pfn(). Any patch set that continues to use >> it is not likely to be using a proper algorithm. > > Do you have any suggestion about how to avoid it? Yes: get the pfns from the page free lists alone. Don't derive them from the pfn limits of the system or zones.
2016 Nov 07
0
[PATCH kernel v4 7/7] virtio-balloon: tell host vm's unused page info
...virtio_has_feature(vb->vdev, > VIRTIO_BALLOON_F_PAGE_BITMAP) && > > + vb->nr_page_bmap == 1) > > + extend_page_bitmap(vb); > > + > > + pfn_limit = PFNS_PER_BMAP * vb->nr_page_bmap; > > + mutex_lock(&vb->balloon_lock); > > + last_pfn = get_max_pfn(); > > + > > + while (ret) { > > + clear_page_bitmap(vb); > > + ret = get_unused_pages(pfn, pfn + pfn_limit, vb- > >page_bitmap, > > + PFNS_PER_BMAP, vb->nr_page_bmap); > > This changed the underlying data structure without changing the way that &g...
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
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
.....5330b6f 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -45,6 +45,8 @@ static int oom_pages = OOM_VBALLOON_DEFAULT_PAGES; module_param(oom_pages, int, S_IRUSR | S_IWUSR); MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); +extern unsigned long get_max_pfn(void); + struct virtio_balloon { struct virtio_device *vdev; struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; @@ -62,6 +64,9 @@ struct virtio_balloon { /* Number of balloon pages we've told the Host we're not using. */ unsigned int num_pages; + unsigned long *page_bitmap; +...
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
.....5330b6f 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -45,6 +45,8 @@ static int oom_pages = OOM_VBALLOON_DEFAULT_PAGES; module_param(oom_pages, int, S_IRUSR | S_IWUSR); MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); +extern unsigned long get_max_pfn(void); + struct virtio_balloon { struct virtio_device *vdev; struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; @@ -62,6 +64,9 @@ struct virtio_balloon { /* Number of balloon pages we've told the Host we're not using. */ unsigned int num_pages; + unsigned long *page_bitmap; +...
2016 Jul 28
2
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...7] virtio-balloon: speed up inflate/deflate > process > > On Wed, Jul 27, 2016 at 09:03:21AM -0700, Dave Hansen wrote: > > On 07/26/2016 06:23 PM, Liang Li wrote: > > > + vb->pfn_limit = VIRTIO_BALLOON_PFNS_LIMIT; > > > + vb->pfn_limit = min(vb->pfn_limit, get_max_pfn()); > > > + vb->bmap_len = ALIGN(vb->pfn_limit, BITS_PER_LONG) / > > > + BITS_PER_BYTE + 2 * sizeof(unsigned long); > > > + hdr_len = sizeof(struct balloon_bmap_hdr); > > > + vb->bmap_hdr = kzalloc(hdr_len + vb->bmap_len, GFP_KERNEL); > > >...
2016 Jul 28
2
[PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process
...7] virtio-balloon: speed up inflate/deflate > process > > On Wed, Jul 27, 2016 at 09:03:21AM -0700, Dave Hansen wrote: > > On 07/26/2016 06:23 PM, Liang Li wrote: > > > + vb->pfn_limit = VIRTIO_BALLOON_PFNS_LIMIT; > > > + vb->pfn_limit = min(vb->pfn_limit, get_max_pfn()); > > > + vb->bmap_len = ALIGN(vb->pfn_limit, BITS_PER_LONG) / > > > + BITS_PER_BYTE + 2 * sizeof(unsigned long); > > > + hdr_len = sizeof(struct balloon_bmap_hdr); > > > + vb->bmap_hdr = kzalloc(hdr_len + vb->bmap_len, GFP_KERNEL); > > >...
2016 May 24
4
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...gt; +++ b/drivers/virtio/virtio_balloon.c > > @@ -45,6 +45,8 @@ static int oom_pages = > OOM_VBALLOON_DEFAULT_PAGES; > > module_param(oom_pages, int, S_IRUSR | S_IWUSR); > > MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); > > > > +extern unsigned long get_max_pfn(void); > > + > > struct virtio_balloon { > > struct virtio_device *vdev; > > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; @@ -62,6 +64,9 > > @@ struct virtio_balloon { > > > > /* Number of balloon pages we've told the Host we're not...
2016 May 24
4
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...gt; +++ b/drivers/virtio/virtio_balloon.c > > @@ -45,6 +45,8 @@ static int oom_pages = > OOM_VBALLOON_DEFAULT_PAGES; > > module_param(oom_pages, int, S_IRUSR | S_IWUSR); > > MODULE_PARM_DESC(oom_pages, "pages to free on OOM"); > > > > +extern unsigned long get_max_pfn(void); > > + > > struct virtio_balloon { > > struct virtio_device *vdev; > > struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; @@ -62,6 +64,9 > > @@ struct virtio_balloon { > > > > /* Number of balloon pages we've told the Host we're not...