From: Alexander Graf <agraf@suse.de>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Xen Devel <xen-devel@lists.xensource.com>,
QEMU-devel <qemu-devel@nongnu.org>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Qemu-devel] [PATCH] xen-mapcache: Fix rlimit set size.
Date: Tue, 02 Aug 2011 16:50:30 +0200 [thread overview]
Message-ID: <4E380EB6.6050505@suse.de> (raw)
In-Reply-To: <1312226782-26882-2-git-send-email-anthony.perard@citrix.com>
On 08/01/2011 09:26 PM, Anthony PERARD wrote:
> Previously, the address space soft limit was set mcache_max_size. So,
> before the mcache_max_size was reached by the mapcache, QEMU was killed
> for overuse of the virtual address space.
>
> This patch fix that by setting the soft limit to mcache_max_size + 80MB.
> I observed that QEMU use 75MB more than max_mcache_size after several
> empirical tests.
Not sure I understand. What are those 75MB?
Alex
> Signed-off-by: Anthony PERARD<anthony.perard@citrix.com>
> ---
> xen-mapcache.c | 13 ++++++++++---
> 1 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/xen-mapcache.c b/xen-mapcache.c
> index 007136a..40212f7 100644
> --- a/xen-mapcache.c
> +++ b/xen-mapcache.c
> @@ -40,6 +40,13 @@
> #endif
> #define MCACHE_BUCKET_SIZE (1UL<< MCACHE_BUCKET_SHIFT)
>
> +/* This is the size of the virtual address space reserve to QEMU that will not
> + * be use by MapCache.
> + * From empirical tests I observed that qemu use 75MB more than the
> + * max_mcache_size.
> + */
> +#define NON_MCACHE_MEMORY_SIZE (80 * 1024 * 1024)
> +
> #define mapcache_lock() ((void)0)
> #define mapcache_unlock() ((void)0)
>
> @@ -93,14 +100,14 @@ void xen_map_cache_init(void)
> mapcache->last_address_index = -1;
>
> getrlimit(RLIMIT_AS,&rlimit_as);
> - if (rlimit_as.rlim_max< MCACHE_MAX_SIZE) {
> + if (rlimit_as.rlim_max< MCACHE_MAX_SIZE + NON_MCACHE_MEMORY_SIZE) {
> rlimit_as.rlim_cur = rlimit_as.rlim_max;
> } else {
> - rlimit_as.rlim_cur = MCACHE_MAX_SIZE;
> + rlimit_as.rlim_cur = MCACHE_MAX_SIZE + NON_MCACHE_MEMORY_SIZE;
> }
>
> setrlimit(RLIMIT_AS,&rlimit_as);
> - mapcache->max_mcache_size = rlimit_as.rlim_cur;
> + mapcache->max_mcache_size = rlimit_as.rlim_cur - NON_MCACHE_MEMORY_SIZE;
>
> mapcache->nr_buckets =
> (((mapcache->max_mcache_size>> XC_PAGE_SHIFT) +
WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Xen Devel <xen-devel@lists.xensource.com>,
QEMU-devel <qemu-devel@nongnu.org>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH] xen-mapcache: Fix rlimit set size.
Date: Tue, 02 Aug 2011 16:50:30 +0200 [thread overview]
Message-ID: <4E380EB6.6050505@suse.de> (raw)
In-Reply-To: <1312226782-26882-2-git-send-email-anthony.perard@citrix.com>
On 08/01/2011 09:26 PM, Anthony PERARD wrote:
> Previously, the address space soft limit was set mcache_max_size. So,
> before the mcache_max_size was reached by the mapcache, QEMU was killed
> for overuse of the virtual address space.
>
> This patch fix that by setting the soft limit to mcache_max_size + 80MB.
> I observed that QEMU use 75MB more than max_mcache_size after several
> empirical tests.
Not sure I understand. What are those 75MB?
Alex
> Signed-off-by: Anthony PERARD<anthony.perard@citrix.com>
> ---
> xen-mapcache.c | 13 ++++++++++---
> 1 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/xen-mapcache.c b/xen-mapcache.c
> index 007136a..40212f7 100644
> --- a/xen-mapcache.c
> +++ b/xen-mapcache.c
> @@ -40,6 +40,13 @@
> #endif
> #define MCACHE_BUCKET_SIZE (1UL<< MCACHE_BUCKET_SHIFT)
>
> +/* This is the size of the virtual address space reserve to QEMU that will not
> + * be use by MapCache.
> + * From empirical tests I observed that qemu use 75MB more than the
> + * max_mcache_size.
> + */
> +#define NON_MCACHE_MEMORY_SIZE (80 * 1024 * 1024)
> +
> #define mapcache_lock() ((void)0)
> #define mapcache_unlock() ((void)0)
>
> @@ -93,14 +100,14 @@ void xen_map_cache_init(void)
> mapcache->last_address_index = -1;
>
> getrlimit(RLIMIT_AS,&rlimit_as);
> - if (rlimit_as.rlim_max< MCACHE_MAX_SIZE) {
> + if (rlimit_as.rlim_max< MCACHE_MAX_SIZE + NON_MCACHE_MEMORY_SIZE) {
> rlimit_as.rlim_cur = rlimit_as.rlim_max;
> } else {
> - rlimit_as.rlim_cur = MCACHE_MAX_SIZE;
> + rlimit_as.rlim_cur = MCACHE_MAX_SIZE + NON_MCACHE_MEMORY_SIZE;
> }
>
> setrlimit(RLIMIT_AS,&rlimit_as);
> - mapcache->max_mcache_size = rlimit_as.rlim_cur;
> + mapcache->max_mcache_size = rlimit_as.rlim_cur - NON_MCACHE_MEMORY_SIZE;
>
> mapcache->nr_buckets =
> (((mapcache->max_mcache_size>> XC_PAGE_SHIFT) +
next prev parent reply other threads:[~2011-08-02 14:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-01 19:26 [Qemu-devel] [PATCH] xen-mapcache: Fix rlimit set size Anthony PERARD
2011-08-01 19:26 ` Anthony PERARD
2011-08-02 14:50 ` Alexander Graf [this message]
2011-08-02 14:50 ` Alexander Graf
2011-08-04 13:33 ` [Qemu-devel] " Anthony PERARD
2011-08-04 13:33 ` Anthony PERARD
2011-08-02 22:01 ` [Qemu-devel] " Stefano Stabellini
2011-08-02 22:01 ` Stefano Stabellini
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=4E380EB6.6050505@suse.de \
--to=agraf@suse.de \
--cc=anthony.perard@citrix.com \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.