From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: v.tolstov@selfip.ru, Ian Campbell <Ian.Campbell@citrix.com>
Cc: jeremy@goop.org, xen-devel@lists.xensource.com,
Dushmanta Mohapatra <dmpatra@gmail.com>,
JBeulich@novell.com, Konrad Wilk <konrad.wilk@oracle.com>
Subject: RE: [PATCH] [linux-2.6.39.x for xen] tmem: self-ballooning and frontswap-selfshrinking
Date: Tue, 7 Jun 2011 09:40:34 -0700 (PDT) [thread overview]
Message-ID: <1f8b0b5f-46b2-44c7-b850-ece8dbe99aeb@default> (raw)
In-Reply-To: <1307457441.2725.3.camel@mobile>
> > Is there any particular reason this (all) needs to be in the kernel at
> > all? Can a userspace daemon, using (possibly new) statistics exported
> > via /sys and /proc plus the existing balloon interfaces not implement
> > much the same thing? One nice advantage of doing that is that a
> > userspace daemon can more easily implement complex (or multiple)
> > algorithms, tune them etc. If there is a good reason for this to be in
> > kernel I think it should be expanded upon in the commit message.
> >
> > Ian.
>
> I'm agree with Ian. Some time ago i write daemon that balloon up/down
> memory, most of the time it work's fine. But with specific software -
> for example mongodb and java aplications - algorithm needs changing and
> after some time i go to idea, that userspace can acts as ulatencyd -
> kernel provide interface to calculate and to up/down memory (in this
> case kernel need to provide frontswap shrink...) userspace daemon use
> statistics and interface can apply various memory calcalation patterns
> to various workloads and software used in server.
It certainly *can* be done. I demonstrated that at Xen Summit 2008
and the userland code has been in the Xen tools/misc tree
since Fall 2008.
I found some time ago that aggressive ballooning with widely
varying workload frequently caused OOMs that went away when
the selfballooning and frontswap-selfshrinking code was put in
the kernel, presumably making it more responsive. The often fatal
nature of OOMs make it difficult to debug... it may be
possible to change the userspace code, for example, to sample
and adjust at a higher frequency... IIRC I just went with
doing it in the kernel because it was what worked.
The real objective is for the kernel to be less "selfish" with
its memory. Ideally, there should be a generic mechanism for
the kernel to "surrender" memory that it can live without...
and perhaps it plugs into the balloon driver, perhaps hotplug,
or perhaps something else. However "memory it can live
without" is as vague as (and essentially the complement
of) "working set".
The use of "committed_as" is really just one estimator of
how "lean" the kernel could be and it happened to be exposed
in userspace. It's also very aggressive, probably too aggressive
unless tmem is running. I suspect there are better algorithms...
and those algorithms may not have all data exposed in userspace.
Dan
next prev parent reply other threads:[~2011-06-07 16:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-06 22:12 [PATCH] [linux-2.6.39.x for xen] tmem: self-ballooning and frontswap-selfshrinking Dan Magenheimer
2011-06-07 9:34 ` Ian Campbell
2011-06-07 14:37 ` Vasiliy G Tolstov
2011-06-07 16:40 ` Dan Magenheimer [this message]
2011-06-07 16:21 ` Dan Magenheimer
2011-06-07 16:40 ` Ian Campbell
2011-06-07 16:59 ` Dan Magenheimer
2011-06-07 19:37 ` Ian Campbell
2011-06-07 16:46 ` Ian Campbell
2011-06-09 17:21 ` Daniel Kiper
2011-06-09 21:12 ` Dan Magenheimer
2011-06-10 11:53 ` Daniel Kiper
2011-06-14 9:15 ` Ian Campbell
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=1f8b0b5f-46b2-44c7-b850-ece8dbe99aeb@default \
--to=dan.magenheimer@oracle.com \
--cc=Ian.Campbell@citrix.com \
--cc=JBeulich@novell.com \
--cc=dmpatra@gmail.com \
--cc=jeremy@goop.org \
--cc=konrad.wilk@oracle.com \
--cc=v.tolstov@selfip.ru \
--cc=xen-devel@lists.xensource.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).