search for: virtio_balloon_pfn_shift

Displaying 20 results from an estimated 262 matches for "virtio_balloon_pfn_shift".

2020 Mar 12
0
[RFC for QEMU] virtio-balloon: Add option thp-order to set VIRTIO_BALLOON_F_THP_ORDER
...) > while (iov_to_buf(elem->out_sg, elem->out_num, offset, &pfn, 4) == 4) { > unsigned int p = virtio_ldl_p(vdev, &pfn); > hwaddr pa; > + size_t handle_size = BALLOON_PAGE_SIZE; > > pa = (hwaddr) p << VIRTIO_BALLOON_PFN_SHIFT; > offset += 4; > > - section = memory_region_find(get_system_memory(), pa, > - BALLOON_PAGE_SIZE); > - if (!section.mr) { > - trace_virtio_balloon_bad_addr(pa); > - conti...
2012 Apr 13
0
[PATCH] virtio_balloon: fix handling of PAGE_SIZE != 4k
.../ unsigned int num_pages; struct list_head pages; @@ -60,13 +63,23 @@ static struct virtio_device_id id_table[] = { { 0 }, }; +/* Balloon device works in 4K page units. So each page is + * pointed to by multiple balloon pages. */ +#define VIRTIO_BALLOON_PAGES_PER_PAGE (PAGE_SIZE >> VIRTIO_BALLOON_PFN_SHIFT) + static u32 page_to_balloon_pfn(struct page *page) { 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 *...
2012 Apr 13
0
[PATCH] virtio_balloon: fix handling of PAGE_SIZE != 4k
.../ unsigned int num_pages; struct list_head pages; @@ -60,13 +63,23 @@ static struct virtio_device_id id_table[] = { { 0 }, }; +/* Balloon device works in 4K page units. So each page is + * pointed to by multiple balloon pages. */ +#define VIRTIO_BALLOON_PAGES_PER_PAGE (PAGE_SIZE >> VIRTIO_BALLOON_PFN_SHIFT) + static u32 page_to_balloon_pfn(struct page *page) { 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 *...
2015 Jan 15
2
[PATCH] virtio_balloon: coding style fixes
...ions(+), 4 deletions(-) diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h index be40f70..4b0488f 100644 --- a/include/uapi/linux/virtio_balloon.h +++ b/include/uapi/linux/virtio_balloon.h @@ -36,8 +36,7 @@ /* Size of a PFN in the balloon interface. */ #define VIRTIO_BALLOON_PFN_SHIFT 12 -struct virtio_balloon_config -{ +struct virtio_balloon_config { /* Number of pages host wants Guest to give up. */ __le32 num_pages; /* Number of pages we've actually got in balloon. */ diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 3176ea4..041...
2015 Jan 15
2
[PATCH] virtio_balloon: coding style fixes
...ions(+), 4 deletions(-) diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h index be40f70..4b0488f 100644 --- a/include/uapi/linux/virtio_balloon.h +++ b/include/uapi/linux/virtio_balloon.h @@ -36,8 +36,7 @@ /* Size of a PFN in the balloon interface. */ #define VIRTIO_BALLOON_PFN_SHIFT 12 -struct virtio_balloon_config -{ +struct virtio_balloon_config { /* Number of pages host wants Guest to give up. */ __le32 num_pages; /* Number of pages we've actually got in balloon. */ diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 3176ea4..041...
2017 Jun 09
0
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...N_MAX_PAGE_CHUNKS) - send_page_chunks(vb, vq); + send_page_chunks(vb, vq, type, false); } static void convert_bmap_to_chunks(struct virtio_balloon *vb, @@ -264,7 +329,8 @@ static void convert_bmap_to_chunks(struct virtio_balloon *vb, chunk_base_addr = (pfn_start + next_one) << VIRTIO_BALLOON_PFN_SHIFT; if (chunk_size) { - add_one_chunk(vb, vq, chunk_base_addr, chunk_size); + add_one_chunk(vb, vq, PAGE_CHUNK_TYPE_BALLOON, + chunk_base_addr, chunk_size); pos += next_zero + 1; } } @@ -311,7 +377,7 @@ static void tell_host_from_page_bmap(struct virtio_balloon *vb,...
2017 Jan 12
2
[PATCH v6 kernel 2/5] virtio-balloon: define new feature bit and head struct
.../ > #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */ > #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ > +#define VIRTIO_BALLOON_F_PAGE_RANGE 3 /* Send page info with ranges */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > > +/* Bits width for the length of the pfn range */ What does this mean? Couldn't figure it out. > +#define VIRTIO_BALLOON_NR_PFN_BITS 12 > + > struct virtio_balloon_config { > /* Number of pages host wants Guest to give up. */ > __u32 num_pages; > @@ -82,4...
2017 Jan 12
2
[PATCH v6 kernel 2/5] virtio-balloon: define new feature bit and head struct
.../ > #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */ > #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ > +#define VIRTIO_BALLOON_F_PAGE_RANGE 3 /* Send page info with ranges */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > > +/* Bits width for the length of the pfn range */ What does this mean? Couldn't figure it out. > +#define VIRTIO_BALLOON_NR_PFN_BITS 12 > + > struct virtio_balloon_config { > /* Number of pages host wants Guest to give up. */ > __u32 num_pages; > @@ -82,4...
2016 Apr 01
0
Ballooning on TPS!=HPS hosts
...t actually generate an error since > we don't check the return of qemu_madvise. ... at least we can deflate the balloon in case the madvise fails, so the guest can use the pages it's given us. > We have three sizes: > a) host page size > b) target page size > c) VIRTIO_BALLOON_PFN_SHIFT > > c == 12 (4k) for everyone > > > 1) I think the virtio-balloon code needs to coallesce adjecent requests > and call balloon_page on whole chunks at once passing a length. > 2) why does balloon_page use TARGET_PAGE_SIZE, ignoring anything else > s...
2017 Jun 12
1
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...; > + migratetype++) { > + do { > + ret = report_unused_page_block(zone, > + order, migratetype, &page); > + if (!ret) { > + pfn = (u64)page_to_pfn(page); > + add_one_chunk(vb, vq, > + PAGE_CHNUK_UNUSED_PAGE, > + pfn << VIRTIO_BALLOON_PFN_SHIFT, > + (u64)(1 << order) * > + VIRTIO_BALLOON_PAGES_PER_PAGE); > + } > + } while (!ret); > + } > + } > + } This is pretty unreadable. Please add some indentation. If you go over 80 cols, then you might need to break this up into a separate function....
2016 Apr 01
0
Ballooning on TPS!=HPS hosts
...t actually generate an error since > we don't check the return of qemu_madvise. ... at least we can deflate the balloon in case the madvise fails, so the guest can use the pages it's given us. > We have three sizes: > a) host page size > b) target page size > c) VIRTIO_BALLOON_PFN_SHIFT > > c == 12 (4k) for everyone > > > 1) I think the virtio-balloon code needs to coallesce adjecent requests > and call balloon_page on whole chunks at once passing a length. > 2) why does balloon_page use TARGET_PAGE_SIZE, ignoring anything else > s...
2017 Jun 12
1
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...; > + migratetype++) { > + do { > + ret = report_unused_page_block(zone, > + order, migratetype, &page); > + if (!ret) { > + pfn = (u64)page_to_pfn(page); > + add_one_chunk(vb, vq, > + PAGE_CHNUK_UNUSED_PAGE, > + pfn << VIRTIO_BALLOON_PFN_SHIFT, > + (u64)(1 << order) * > + VIRTIO_BALLOON_PAGES_PER_PAGE); > + } > + } while (!ret); > + } > + } > + } This is pretty unreadable. Please add some indentation. If you go over 80 cols, then you might need to break this up into a separate function....
2020 May 13
0
[RFC v3 for QEMU] virtio-balloon: Add option cont-pages to set VIRTIO_BALLOON_VQ_INFLATE_CONT
...it a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c > index a4729f7..84d47d3 100644 > --- a/hw/virtio/virtio-balloon.c > +++ b/hw/virtio/virtio-balloon.c > @@ -34,6 +34,7 @@ > #include "hw/virtio/virtio-access.h" > > #define BALLOON_PAGE_SIZE (1 << VIRTIO_BALLOON_PFN_SHIFT) > +#define CONT_PAGES_ORDER 9 > > typedef struct PartiallyBalloonedPage { > ram_addr_t base_gpa; > @@ -72,6 +73,8 @@ static void balloon_inflate_page(VirtIOBalloon *balloon, > RAMBlock *rb; > size_t rb_page_size; > int subpages; > + size_t inf...
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.
2016 Oct 24
1
[RESEND PATCH v3 kernel 2/7] virtio-balloon: define new feature bit and page bitmap head
...> #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */ > #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ > +#define VIRTIO_BALLOON_F_PAGE_BITMAP 3 /* Send page info with bitmap */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > @@ -82,4 +83,22 @@ struct virtio_balloon_stat { > __virtio64 val; > } __attribute__((packed)); > > +/* Page bitmap header structure */ > +struct balloon_bmap_hdr { > + /* Used to distinguish different request */ > + __virtio16 cmd; > + /* Shift width of page in...
2016 Oct 24
1
[RESEND PATCH v3 kernel 2/7] virtio-balloon: define new feature bit and page bitmap head
...> #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */ > #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ > +#define VIRTIO_BALLOON_F_PAGE_BITMAP 3 /* Send page info with bitmap */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > @@ -82,4 +83,22 @@ struct virtio_balloon_stat { > __virtio64 val; > } __attribute__((packed)); > > +/* Page bitmap header structure */ > +struct balloon_bmap_hdr { > + /* Used to distinguish different request */ > + __virtio16 cmd; > + /* Shift width of page in...
2017 Jan 17
2
[virtio-dev] Re: [PATCH v6 kernel 2/5] virtio-balloon: define new feature bit and head struct
...; */ > > > #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon > > on OOM */ > > > +#define VIRTIO_BALLOON_F_PAGE_RANGE 3 /* Send page info > > with ranges */ > > > > > > /* Size of a PFN in the balloon interface. */ #define > > > VIRTIO_BALLOON_PFN_SHIFT 12 > > > > > > +/* Bits width for the length of the pfn range */ > > > > What does this mean? Couldn't figure it out. > > > > > +#define VIRTIO_BALLOON_NR_PFN_BITS 12 > > > + > > > struct virtio_balloon_config { > > >...
2017 Jan 17
2
[virtio-dev] Re: [PATCH v6 kernel 2/5] virtio-balloon: define new feature bit and head struct
...; */ > > > #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon > > on OOM */ > > > +#define VIRTIO_BALLOON_F_PAGE_RANGE 3 /* Send page info > > with ranges */ > > > > > > /* Size of a PFN in the balloon interface. */ #define > > > VIRTIO_BALLOON_PFN_SHIFT 12 > > > > > > +/* Bits width for the length of the pfn range */ > > > > What does this mean? Couldn't figure it out. > > > > > +#define VIRTIO_BALLOON_NR_PFN_BITS 12 > > > + > > > struct virtio_balloon_config { > > >...
2014 Oct 15
0
[PATCH 2/2] virtio_balloon: free some memory from balloon on OOM
...t;linux/slab.h> #include <linux/module.h> #include <linux/balloon_compaction.h> +#include <linux/oom.h> /* * Balloon device works in 4K page units. So each page is pointed to by @@ -36,6 +37,12 @@ */ #define VIRTIO_BALLOON_PAGES_PER_PAGE (unsigned)(PAGE_SIZE >> VIRTIO_BALLOON_PFN_SHIFT) #define VIRTIO_BALLOON_ARRAY_PFNS_MAX 256 +#define OOM_VBALLOON_DEFAULT_PAGES 256 +#define VIRTBALLOON_OOM_NOTIFY_PRIORITY 80 + +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");...