search for: bmap_bytes

Displaying 6 results from an estimated 6 matches for "bmap_bytes".

2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...* The pages we've told the Host we're not using are enqueued * at vb_dev_info->pages list. @@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq) wake_up(&vb->acked); } +static int balloon_page_bitmap_init(struct virtio_balloon *vb) +{ + unsigned long max_pfn, bmap_bytes; + + max_pfn = get_max_pfn(); + bmap_bytes = ALIGN(max_pfn, BITS_PER_LONG) / BITS_PER_BYTE; + if (!vb->page_bitmap) + vb->page_bitmap = kzalloc(bmap_bytes, GFP_KERNEL); + else { + if (bmap_bytes <= vb->bmap_len) + memset(vb->page_bitmap, 0, bmap_bytes); + else { + kfree(vb-&gt...
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...* The pages we've told the Host we're not using are enqueued * at vb_dev_info->pages list. @@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq) wake_up(&vb->acked); } +static int balloon_page_bitmap_init(struct virtio_balloon *vb) +{ + unsigned long max_pfn, bmap_bytes; + + max_pfn = get_max_pfn(); + bmap_bytes = ALIGN(max_pfn, BITS_PER_LONG) / BITS_PER_BYTE; + if (!vb->page_bitmap) + vb->page_bitmap = kzalloc(bmap_bytes, GFP_KERNEL); + else { + if (bmap_bytes <= vb->bmap_len) + memset(vb->page_bitmap, 0, bmap_bytes); + else { + kfree(vb-&gt...
2016 May 24
4
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...d > > * at vb_dev_info->pages list. > > @@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq) > > wake_up(&vb->acked); > > } > > > > +static int balloon_page_bitmap_init(struct virtio_balloon *vb) { > > + unsigned long max_pfn, bmap_bytes; > > + > > + max_pfn = get_max_pfn(); > > This is racy. max_pfn could be increased by memory hotplug after you got it. > > > > + bmap_bytes = ALIGN(max_pfn, BITS_PER_LONG) / BITS_PER_BYTE; > > + if (!vb->page_bitmap) > > + vb->page_bitmap = kzallo...
2016 May 24
4
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...d > > * at vb_dev_info->pages list. > > @@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq) > > wake_up(&vb->acked); > > } > > > > +static int balloon_page_bitmap_init(struct virtio_balloon *vb) { > > + unsigned long max_pfn, bmap_bytes; > > + > > + max_pfn = get_max_pfn(); > > This is racy. max_pfn could be increased by memory hotplug after you got it. > > > > + bmap_bytes = ALIGN(max_pfn, BITS_PER_LONG) / BITS_PER_BYTE; > > + if (!vb->page_bitmap) > > + vb->page_bitmap = kzallo...
2016 May 20
0
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...39;re not using are enqueued > * at vb_dev_info->pages list. > @@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq) > wake_up(&vb->acked); > } > > +static int balloon_page_bitmap_init(struct virtio_balloon *vb) > +{ > + unsigned long max_pfn, bmap_bytes; > + > + max_pfn = get_max_pfn(); This is racy. max_pfn could be increased by memory hotplug after you got it. > + bmap_bytes = ALIGN(max_pfn, BITS_PER_LONG) / BITS_PER_BYTE; > + if (!vb->page_bitmap) > + vb->page_bitmap = kzalloc(bmap_bytes, GFP_KERNEL); Likely to fail fo...
2016 May 24
0
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...o->pages list. > > > @@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq) > > > wake_up(&vb->acked); > > > } > > > > > > +static int balloon_page_bitmap_init(struct virtio_balloon *vb) { > > > + unsigned long max_pfn, bmap_bytes; > > > + > > > + max_pfn = get_max_pfn(); > > > > This is racy. max_pfn could be increased by memory hotplug after you got it. > > > > > > > + bmap_bytes = ALIGN(max_pfn, BITS_PER_LONG) / BITS_PER_BYTE; > > > + if (!vb->page_bitmap)...