Tetsuo Handa
2018-Aug-02 11:00 UTC
[PATCH v2 2/2] virtio_balloon: replace oom notifier with shrinker
On 2018/08/02 19:32, Wei Wang wrote:> On 08/01/2018 07:34 PM, Michal Hocko wrote: >> Do you have any numbers for how does this work in practice? > > It works in this way: for example, we can set the parameter, balloon_pages_to_shrink, > to shrink 1GB memory once shrink scan is called. Now, we have a 8GB guest, and we balloon > out 7GB. When shrink scan is called, the balloon driver will get back 1GB memory and give > them back to mm, then the ballooned memory becomes 6GB.Since shrinker might be called concurrently (am I correct?), the balloon might deflate far more than needed if it releases such much memory. If shrinker is used, releasing 256 pages might be sufficient.
Wei Wang
2018-Aug-02 11:27 UTC
[PATCH v2 2/2] virtio_balloon: replace oom notifier with shrinker
On 08/02/2018 07:00 PM, Tetsuo Handa wrote:> On 2018/08/02 19:32, Wei Wang wrote: >> On 08/01/2018 07:34 PM, Michal Hocko wrote: >>> Do you have any numbers for how does this work in practice? >> It works in this way: for example, we can set the parameter, balloon_pages_to_shrink, >> to shrink 1GB memory once shrink scan is called. Now, we have a 8GB guest, and we balloon >> out 7GB. When shrink scan is called, the balloon driver will get back 1GB memory and give >> them back to mm, then the ballooned memory becomes 6GB. > Since shrinker might be called concurrently (am I correct?),Not sure about it being concurrently, but I think it would be called repeatedly as should_continue_reclaim() returns true. Best, Wei
Michal Hocko
2018-Aug-02 11:29 UTC
[PATCH v2 2/2] virtio_balloon: replace oom notifier with shrinker
On Thu 02-08-18 19:27:40, Wei Wang wrote:> On 08/02/2018 07:00 PM, Tetsuo Handa wrote: > > On 2018/08/02 19:32, Wei Wang wrote: > > > On 08/01/2018 07:34 PM, Michal Hocko wrote: > > > > Do you have any numbers for how does this work in practice? > > > It works in this way: for example, we can set the parameter, balloon_pages_to_shrink, > > > to shrink 1GB memory once shrink scan is called. Now, we have a 8GB guest, and we balloon > > > out 7GB. When shrink scan is called, the balloon driver will get back 1GB memory and give > > > them back to mm, then the ballooned memory becomes 6GB. > > Since shrinker might be called concurrently (am I correct?), > > Not sure about it being concurrently, but I think it would be called > repeatedly as should_continue_reclaim() returns true.Multiple direct reclaimers might indeed invoke it concurrently. -- Michal Hocko SUSE Labs
Maybe Matching Threads
- [PATCH v2 2/2] virtio_balloon: replace oom notifier with shrinker
- [PATCH v2 2/2] virtio_balloon: replace oom notifier with shrinker
- [PATCH v2 2/2] virtio_balloon: replace oom notifier with shrinker
- [PATCH v2 2/2] virtio_balloon: replace oom notifier with shrinker
- [PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker