search for: virtio_balloon_array_pfns_max

Displaying 20 results from an estimated 141 matches for "virtio_balloon_array_pfns_max".

2017 Oct 22
2
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...b, > > 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; > LIST_HEAD(pages); > + unsigned int num_pfns; > + __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; This array consumes 1024 bytes of kernel stack, doesn't it? leak_balloon() might be called from out_of_memory() where kernel stack is already largely consumed before entering __alloc_pages_nodemask(). For reducing possibility of stack overflow, since out_of_memory() is serialized by oom_lock...
2017 Oct 22
2
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...b, > > 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; > LIST_HEAD(pages); > + unsigned int num_pfns; > + __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; This array consumes 1024 bytes of kernel stack, doesn't it? leak_balloon() might be called from out_of_memory() where kernel stack is already largely consumed before entering __alloc_pages_nodemask(). For reducing possibility of stack overflow, since out_of_memory() is serialized by oom_lock...
2017 Oct 22
0
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...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; >> LIST_HEAD(pages); >> + unsigned int num_pfns; >> + __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; > This array consumes 1024 bytes of kernel stack, doesn't it? > leak_balloon() might be called from out_of_memory() where kernel stack > is already largely consumed before entering __alloc_pages_nodemask(). > For reducing possibility of stack overflow, since out_of_memory() is &gt...
2018 Aug 03
4
[PATCH v3 0/2] virtio-balloon: some improvements
This series is split from the "Virtio-balloon: support free page reporting" series to make some improvements. ChangeLog: v2->v3: - shrink the balloon pages according to the amount requested by the claimer, instead of using a user specified number; v1->v2: - register the shrinker when VIRTIO_BALLOON_F_DEFLATE_ON_OOM is negotiated. Wei Wang (2): virtio-balloon: remove BUG()
2017 Oct 20
0
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...;pages list. @@ -76,12 +76,9 @@ struct virtio_balloon { */ struct balloon_dev_info vb_dev_info; - /* Synchronize access/update to this struct virtio_balloon elements */ - struct mutex balloon_lock; - - /* The array of pfns we tell the Host about. */ - unsigned int num_pfns; - __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; + /* Synchronize access to inflate_vq and deflate_vq respectively */ + struct mutex inflate_lock; + struct mutex deflate_lock; /* Memory statistics */ struct virtio_balloon_stat stats[VIRTIO_BALLOON_S_NR]; @@ -111,12 +108,13 @@ static void balloon_ack(struct virtqueue *vq) wake_up(&vb...
2018 Aug 03
1
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
...ck to mm adaptively by returning the number of pages that the > reclaimer is asking for (i.e. sc->nr_to_scan). > > Currently the max possible value of sc->nr_to_scan passed to the balloon > shrinker is SHRINK_BATCH, which is 128. This is smaller than the > limitation that only VIRTIO_BALLOON_ARRAY_PFNS_MAX (256) pages can be > returned via one invocation of leak_balloon. But this patch still > considers the case that SHRINK_BATCH or shrinker->batch could be changed > to a value larger than VIRTIO_BALLOON_ARRAY_PFNS_MAX, which will need to > do multiple invocations of leak_balloon. >...
2016 May 18
2
[PATCH RFC 0/1] virtio-balloon vs. endianness
Hi Michael, this patch (against your vhost branch) should fix the endianness issues we saw on s390 that I mentioned on irc yesterday. Both the config space and the stats seem to be fine endianness-wise, but the pfns for inflate/deflate were not converted to little endian for virtio-1 (the qemu code is correct). Without the patch, I get an immediate crash on qemu master when started via libvirt
2016 May 18
2
[PATCH RFC 0/1] virtio-balloon vs. endianness
Hi Michael, this patch (against your vhost branch) should fix the endianness issues we saw on s390 that I mentioned on irc yesterday. Both the config space and the stats seem to be fine endianness-wise, but the pfns for inflate/deflate were not converted to little endian for virtio-1 (the qemu code is correct). Without the patch, I get an immediate crash on qemu master when started via libvirt
2017 Oct 20
9
[PATCH v1 0/3] Virtio-balloon Improvement
This patch series intends to summarize the recent contributions made by Michael S. Tsirkin, Tetsuo Handa, Michal Hocko etc. via reporting and discussing the related deadlock issues on the mailinglist. Please check each patch for details. >From a high-level point of view, this patch series achieves: 1) eliminate the deadlock issue fundamentally caused by the inability to run leak_balloon and
2017 Oct 20
9
[PATCH v1 0/3] Virtio-balloon Improvement
This patch series intends to summarize the recent contributions made by Michael S. Tsirkin, Tetsuo Handa, Michal Hocko etc. via reporting and discussing the related deadlock issues on the mailinglist. Please check each patch for details. >From a high-level point of view, this patch series achieves: 1) eliminate the deadlock issue fundamentally caused by the inability to run leak_balloon and
2020 Feb 06
2
[PATCH] virtio_balloon: prevent pfn array overflow
...n.c b/drivers/virtio/virtio_balloon.c index 8e400ece9273..2457c54b6185 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -158,6 +158,8 @@ static void set_page_pfns(struct virtio_balloon *vb, { unsigned int i; + BUILD_BUG_ON(VIRTIO_BALLOON_PAGES_PER_PAGE > VIRTIO_BALLOON_ARRAY_PFNS_MAX); + /* * Set balloon pfns pointing at this page. * Note that the first pfn points at start of the page. -- MST
2018 Aug 03
0
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
...alloon pages are given back to mm adaptively by returning the number of pages that the reclaimer is asking for (i.e. sc->nr_to_scan). Currently the max possible value of sc->nr_to_scan passed to the balloon shrinker is SHRINK_BATCH, which is 128. This is smaller than the limitation that only VIRTIO_BALLOON_ARRAY_PFNS_MAX (256) pages can be returned via one invocation of leak_balloon. But this patch still considers the case that SHRINK_BATCH or shrinker->batch could be changed to a value larger than VIRTIO_BALLOON_ARRAY_PFNS_MAX, which will need to do multiple invocations of leak_balloon. Historically, the featu...
2018 Jul 22
2
[PATCH v36 2/5] virtio_balloon: replace oom notifier with shrinker
...the reasons mentioned > here by Michal Hocko: https://lkml.org/lkml/2018/7/12/314 > > This patch replaces the virtio-balloon oom notifier with a shrinker > to release balloon pages on memory pressure. > > In addition, the bug in the replaced virtballoon_oom_notify that only > VIRTIO_BALLOON_ARRAY_PFNS_MAX (i.e 256) balloon pages can be freed > though the user has specified more than that number is fixed in the > shrinker_scan function. > > Signed-off-by: Wei Wang <wei.w.wang at intel.com> > Cc: Michael S. Tsirkin <mst at redhat.com> > Cc: Michal Hocko <mhocko at ker...
2018 Jul 22
2
[PATCH v36 2/5] virtio_balloon: replace oom notifier with shrinker
...the reasons mentioned > here by Michal Hocko: https://lkml.org/lkml/2018/7/12/314 > > This patch replaces the virtio-balloon oom notifier with a shrinker > to release balloon pages on memory pressure. > > In addition, the bug in the replaced virtballoon_oom_notify that only > VIRTIO_BALLOON_ARRAY_PFNS_MAX (i.e 256) balloon pages can be freed > though the user has specified more than that number is fixed in the > shrinker_scan function. > > Signed-off-by: Wei Wang <wei.w.wang at intel.com> > Cc: Michael S. Tsirkin <mst at redhat.com> > Cc: Michal Hocko <mhocko at ker...
2018 Jul 27
5
[PATCH v2 0/2] virtio-balloon: some improvements
This series is split from the "Virtio-balloon: support free page reporting" series to make some improvements. v1->v2 ChangeLog: - register the shrinker when VIRTIO_BALLOON_F_DEFLATE_ON_OOM is negotiated. Wei Wang (2): virtio-balloon: remove BUG() in init_vqs virtio_balloon: replace oom notifier with shrinker drivers/virtio/virtio_balloon.c | 125
2018 Jul 27
5
[PATCH v2 0/2] virtio-balloon: some improvements
This series is split from the "Virtio-balloon: support free page reporting" series to make some improvements. v1->v2 ChangeLog: - register the shrinker when VIRTIO_BALLOON_F_DEFLATE_ON_OOM is negotiated. Wei Wang (2): virtio-balloon: remove BUG() in init_vqs virtio_balloon: replace oom notifier with shrinker drivers/virtio/virtio_balloon.c | 125
2016 May 18
4
[PATCH] virtio_balloon: fix PFN format for virtio-1
...ivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 7b6d74f..476c0e3 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -75,7 +75,7 @@ struct virtio_balloon { /* The array of pfns we tell the Host about. */ unsigned int num_pfns; - u32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; + __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; /* Memory statistics */ struct virtio_balloon_stat stats[VIRTIO_BALLOON_S_NR]; @@ -127,14 +127,16 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) } -static void set_page_pfns(u32 pfns[], struct page *page) +sta...
2016 May 18
4
[PATCH] virtio_balloon: fix PFN format for virtio-1
...ivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 7b6d74f..476c0e3 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -75,7 +75,7 @@ struct virtio_balloon { /* The array of pfns we tell the Host about. */ unsigned int num_pfns; - u32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; + __virtio32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX]; /* Memory statistics */ struct virtio_balloon_stat stats[VIRTIO_BALLOON_S_NR]; @@ -127,14 +127,16 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) } -static void set_page_pfns(u32 pfns[], struct page *page) +sta...
2018 Jul 27
0
[PATCH v2 2/2] virtio_balloon: replace oom notifier with shrinker
...r is getting deprecated to use for the reasons mentioned here by Michal Hocko: https://lkml.org/lkml/2018/7/12/314 This patch replaces the virtio-balloon oom notifier with a shrinker to release balloon pages on memory pressure. In addition, the bug in the replaced virtballoon_oom_notify that only VIRTIO_BALLOON_ARRAY_PFNS_MAX (i.e 256) balloon pages can be freed though the user has specified more than that number is fixed in the shrinker_scan function. Signed-off-by: Wei Wang <wei.w.wang at intel.com> Cc: Michael S. Tsirkin <mst at redhat.com> Cc: Michal Hocko <mhocko at kernel.org> Cc: Andrew Morton...
2018 Jul 20
0
[PATCH v36 2/5] virtio_balloon: replace oom notifier with shrinker
...r is getting deprecated to use for the reasons mentioned here by Michal Hocko: https://lkml.org/lkml/2018/7/12/314 This patch replaces the virtio-balloon oom notifier with a shrinker to release balloon pages on memory pressure. In addition, the bug in the replaced virtballoon_oom_notify that only VIRTIO_BALLOON_ARRAY_PFNS_MAX (i.e 256) balloon pages can be freed though the user has specified more than that number is fixed in the shrinker_scan function. Signed-off-by: Wei Wang <wei.w.wang at intel.com> Cc: Michael S. Tsirkin <mst at redhat.com> Cc: Michal Hocko <mhocko at kernel.org> Cc: Andrew Morton...