From: Wei Wang <wei.w.wang@intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
Nitesh Narayan Lal <nitesh@redhat.com>,
kvm list <kvm@vger.kernel.org>,
David Hildenbrand <david@redhat.com>,
"Hansen, Dave" <dave.hansen@intel.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Yang Zhang <yang.zhang.wz@gmail.com>,
"pagupta@redhat.com" <pagupta@redhat.com>,
Rik van Riel <riel@surriel.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
"lcapitulino@redhat.com" <lcapitulino@redhat.com>,
Andrea Arcangeli <aarcange@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"Williams, Dan J" <dan.j.williams@intel.com>,
Alexander Duyck <alexander.h.duyck@linux.intel.com>
Subject: Re: use of shrinker in virtio balloon free page hinting
Date: Thu, 18 Jul 2019 13:57:06 +0800 [thread overview]
Message-ID: <5D300A32.4090300@intel.com> (raw)
In-Reply-To: <20190718000434-mutt-send-email-mst@kernel.org>
On 07/18/2019 12:13 PM, Michael S. Tsirkin wrote:
>
> It makes sense for pages in the balloon (requested by hypervisor).
> However free page hinting can freeze up lots of memory for its own
> internal reasons. It does not make sense to ask hypervisor
> to set flags in order to fix internal guest issues.
Sounds reasonable to me. Probably we could move the flag check to
shrinker_count and shrinker_scan as a reclaiming condition for
ballooning pages only?
>
> Right. But that does not include the pages in the hint vq,
> which could be a significant amount of memory.
I think it includes, as vb->num_free_page_blocks records the total number
of free page blocks that balloon has taken from mm.
For shrink_free_pages, it calls return_free_pages_to_mm, which pops pages
from vb->free_page_list (this is the list where pages get enlisted after
they
are put to the hint vq, see get_free_page_and_send).
>
>
>>> - if free pages are being reported, pages freed
>>> by shrinker will just get re-allocated again
>> fill_balloon will re-try the allocation after sleeping 200ms once allocation fails.
> Even if ballon was never inflated, if shrinker frees some memory while
> we are hinting, hint vq will keep going and allocate it back without
> sleeping.
Still see get_free_page_and_send. -EINTR is returned when page
allocation fails,
and reporting ends then.
Shrinker is called on system memory pressure. On memory pressure
get_free_page_and_send will fail memory allocation, so it stops
allocating more.
Best,
Wei
next prev parent reply other threads:[~2019-07-18 5:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-17 11:20 use of shrinker in virtio balloon free page hinting Michael S. Tsirkin
2019-07-17 11:32 ` David Hildenbrand
2019-07-17 14:10 ` David Hildenbrand
2019-07-17 14:34 ` Michael S. Tsirkin
2019-07-17 14:38 ` David Hildenbrand
2019-07-17 15:46 ` Wang, Wei W
2019-07-18 4:13 ` Michael S. Tsirkin
2019-07-18 5:57 ` Wei Wang [this message]
2019-07-18 5:58 ` Michael S. Tsirkin
2019-07-18 6:30 ` Wei Wang
2019-07-18 6:47 ` Michael S. Tsirkin
2019-07-18 9:08 ` Wei Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5D300A32.4090300@intel.com \
--to=wei.w.wang@intel.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@intel.com \
--cc=david@redhat.com \
--cc=konrad.wilk@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=lcapitulino@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mst@redhat.com \
--cc=nitesh@redhat.com \
--cc=pagupta@redhat.com \
--cc=pbonzini@redhat.com \
--cc=riel@surriel.com \
--cc=yang.zhang.wz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).