Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-14 Thread Tyler Sanderson via Virtualization
Sorry for the slow reply. Re: Module parameters: I prefer not to have module parameters since they are controlled by the guest. In general, in virtualized environments the admins controlling the hypervisor are more knowledgeable about these things than the users. A feature bit seems useful so

Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-11 Thread Tetsuo Handa
On 2020/02/10 16:27, Wang, Wei W wrote: >> Well, my comment is rather: "Do not try to reserve guest's memory. In other >> words, do not try to maintain balloons on the guest side. Since host would >> be able to cache file data on the host's cache, guests would be able to >> quickly fetch file data

RE: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-09 Thread Wang, Wei W
On Monday, February 10, 2020 11:57 AM, Tetsuo Handa wrote: > Then, "node-A's NR_FILE_PAGES is already 0 and node-B's NR_FILE_PAGES is > not 0, but allocation request which triggered this shrinker wants to allocate > from only node-A" > would be confused by this change, for the pagecache pages for

RE: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-09 Thread Tetsuo Handa
Wang, Wei W wrote: > On Saturday, February 8, 2020 8:33 PM, Tetsuo Handa wrote: > > > > Is this NUMA aware? Can "node-A's NR_FILE_PAGES is already 0 and > > node-B's NR_FILE_PAGES is not 0, but allocation request which triggered this > > shrinker wants to allocate from only node-B" happen? > >

RE: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-09 Thread Wang, Wei W
On Saturday, February 8, 2020 8:33 PM, Tetsuo Handa wrote: > > Is this NUMA aware? Can "node-A's NR_FILE_PAGES is already 0 and > node-B's NR_FILE_PAGES is not 0, but allocation request which triggered this > shrinker wants to allocate from only node-B" happen? No, it's a global counter. >Can

Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-08 Thread Tetsuo Handa
On 2020/02/06 17:01, Wei Wang wrote: > There are cases that users want to shrink balloon pages after the > pagecache depleted. The conservative_shrinker lets the shrinker > shrink balloon pages when all the pagecache has been reclaimed. > > @@ -796,6 +800,10 @@ static unsigned long

Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread Michael S. Tsirkin
On Thu, Feb 06, 2020 at 09:43:10AM +, Wang, Wei W wrote: > On Thursday, February 6, 2020 5:31 PM, Michael S. Tsirkin wrote: > > > > How about just making this a last resort thing to be compatible with > > existing > > hypervisors? if someone wants to change behaviour that really should use a

Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread David Hildenbrand
On 06.02.20 10:44, Wang, Wei W wrote: > On Thursday, February 6, 2020 5:32 PM, David Hildenbrand wrote: >> >> If the page cache is empty, a drop_slab() will deflate the whole balloon if I >> am not wrong. >> >> Especially, a echo 3 > /proc/sys/vm/drop_caches >> >> will first drop the page cache

RE: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread Wang, Wei W
On Thursday, February 6, 2020 5:32 PM, David Hildenbrand wrote: > > If the page cache is empty, a drop_slab() will deflate the whole balloon if I > am not wrong. > > Especially, a echo 3 > /proc/sys/vm/drop_caches > > will first drop the page cache and then drop_slab() Then that's the problem

RE: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread Wang, Wei W
On Thursday, February 6, 2020 5:31 PM, Michael S. Tsirkin wrote: > > How about just making this a last resort thing to be compatible with existing > hypervisors? if someone wants to change behaviour that really should use a > feature bit ... Yeah, sounds good to me to control via feature bits.

Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread David Hildenbrand
On 06.02.20 10:28, Wang, Wei W wrote: > On Thursday, February 6, 2020 5:10 PM, David Hildenbrand wrote: >> so dropping caches (echo 3 > /proc/sys/vm/drop_caches) will no longer >> deflate the balloon when conservative_shrinker=true? >> > > Should be. Need Tyler's help to test it. > If the page

Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread Michael S. Tsirkin
On Thu, Feb 06, 2020 at 09:27:04AM +, Wang, Wei W wrote: > On Thursday, February 6, 2020 5:04 PM, Michael S. Tsirkin wrote: > > virtio_balloon_shrinker_count(struct shrinker *shrinker, > > > struct virtio_balloon, shrinker); > > > unsigned long count; > > >

RE: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread Wang, Wei W
On Thursday, February 6, 2020 5:10 PM, David Hildenbrand wrote: > so dropping caches (echo 3 > /proc/sys/vm/drop_caches) will no longer > deflate the balloon when conservative_shrinker=true? > Should be. Need Tyler's help to test it. Best, Wei ___

RE: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread Wang, Wei W
On Thursday, February 6, 2020 5:04 PM, Michael S. Tsirkin wrote: > virtio_balloon_shrinker_count(struct shrinker *shrinker, > > struct virtio_balloon, shrinker); > > unsigned long count; > > > > - count = vb->num_pages / VIRTIO_BALLOON_PAGES_PER_PAGE; > >

Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread David Hildenbrand
On 06.02.20 09:01, Wei Wang wrote: > There are cases that users want to shrink balloon pages after the > pagecache depleted. The conservative_shrinker lets the shrinker > shrink balloon pages when all the pagecache has been reclaimed. > > Signed-off-by: Wei Wang > --- >

Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread Michael S. Tsirkin
On Thu, Feb 06, 2020 at 04:01:47PM +0800, Wei Wang wrote: > There are cases that users want to shrink balloon pages after the > pagecache depleted. The conservative_shrinker lets the shrinker > shrink balloon pages when all the pagecache has been reclaimed. > > Signed-off-by: Wei Wang I'd

[PATCH RFC] virtio_balloon: conservative balloon page shrinking

2020-02-06 Thread Wei Wang
There are cases that users want to shrink balloon pages after the pagecache depleted. The conservative_shrinker lets the shrinker shrink balloon pages when all the pagecache has been reclaimed. Signed-off-by: Wei Wang --- drivers/virtio/virtio_balloon.c | 14 +- 1 file changed, 13