On Thu, Jul 18, 2019 at 08:34:37AM -0700, Alexander Duyck wrote: > > > > For example we allocate pages until shrinker kicks in. > > > > Fair enough but in fact many it would be better to > > > > do the reverse: trigger shrinker and then send as many > > > > free pages as we can to host. > > > > > > I'm not sure I understand this last part. > > > > Oh basically what I am saying is this: one of the reasons to use page > > hinting is when host is short on memory. In that case, why don't we use > > shrinker to ask kernel drivers to free up memory? Any memory freed could > > then be reported to host. > > Didn't the balloon driver already have a feature like that where it > could start shrinking memory if the host was under memory pressure? If > so how would adding another one add much value. Well fundamentally the basic balloon inflate kind of does this, yes :) The difference with what I am suggesting is that balloon inflate tries to aggressively achieve a specific goal of freed memory. We could have a weaker "free as much as you can" that is still stronger than free page hint which as you point out below does not try to free at all, just hints what is already free. > The idea here is if the memory is free we just mark it as such. As > long as we can do so with no noticeable overhead on the guest or host > why not just do it?