From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Wang, Wei W" <wei.w.wang@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"tysand@google.com" <tysand@google.com>,
"david@redhat.com" <david@redhat.com>,
"alexander.h.duyck@linux.intel.com"
<alexander.h.duyck@linux.intel.com>,
"rientjes@google.com" <rientjes@google.com>,
"mhocko@kernel.org" <mhocko@kernel.org>,
"namit@vmware.com" <namit@vmware.com>,
"penguin-kernel@i-love.sakura.ne.jp"
<penguin-kernel@i-love.sakura.ne.jp>
Subject: Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking
Date: Thu, 6 Feb 2020 04:31:01 -0500 [thread overview]
Message-ID: <20200206042824-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <286AC319A985734F985F78AFA26841F73E4238A5@shsmsx102.ccr.corp.intel.com>
On Thu, Feb 06, 2020 at 09:27:04AM +0000, 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;
> > >
> > > - count = vb->num_pages / VIRTIO_BALLOON_PAGES_PER_PAGE;
> > > + if (conservative_shrinker && global_node_page_state(NR_FILE_PAGES))
> >
> > I'd rather have an API for that in mm/. In particular, do we want other
> > shrinkers to run, not just pagecache? To pick an example I'm familiar
> > with, kvm mmu cache for nested virt?
>
> We could make it extendable:
>
> #define BALLOON_SHRINKER_AFTER_PAGE_CACHE (1 << 0)
> #define BALLOON_SHRINKER_AFTER_KVM_MMU_CACHE (1 << 1)
> ...
>
> uint64_t conservative_shrinker;
> if ((conservative_shrinker | BALLOON_SHRINKER_AFTER_PAGE_CACHE) && global_node_page_state(NR_FILE_PAGES))
> return 0;
>
> For now, we probably only need BALLOON_SHRINKER_AFTER_PAGE_CACHE.
>
> Best,
> Wei
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 ...
--
MST
next prev parent reply other threads:[~2020-02-06 9:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 8:01 [PATCH RFC] virtio_balloon: conservative balloon page shrinking Wei Wang
2020-02-06 9:04 ` Michael S. Tsirkin
2020-02-06 9:27 ` Wang, Wei W
2020-02-06 9:31 ` Michael S. Tsirkin [this message]
2020-02-06 9:43 ` Wang, Wei W
2020-02-06 11:26 ` Michael S. Tsirkin
2020-02-06 9:09 ` David Hildenbrand
2020-02-06 9:28 ` Wang, Wei W
2020-02-06 9:32 ` David Hildenbrand
2020-02-06 9:44 ` Wang, Wei W
2020-02-06 9:49 ` David Hildenbrand
2020-02-08 12:32 ` Tetsuo Handa
2020-02-10 3:13 ` Wang, Wei W
2020-02-10 3:57 ` Tetsuo Handa
2020-02-10 7:27 ` Wang, Wei W
2020-02-11 14:18 ` Tetsuo Handa
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=20200206042824-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=alexander.h.duyck@linux.intel.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@kernel.org \
--cc=namit@vmware.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=rientjes@google.com \
--cc=tysand@google.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=wei.w.wang@intel.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