[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V9 10/16] xen: Introduce the Xen mapcache
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-devel] [PATCH V9 10/16] xen: Introduce the Xen mapcache |
Date: |
Thu, 27 Jan 2011 12:04:16 +0000 |
User-agent: |
Alpine 2.00 (DEB 1167 2008-08-23) |
On Wed, 26 Jan 2011, Anthony Liguori wrote:
> > +#ifdef MAPCACHE_DEBUG
> > +# define DPRINTF(fmt, ...) do { \
> > + fprintf(stderr, "xen_mapcache: " fmt, ## __VA_ARGS__); \
> > +} while (0)
> > +#else
> > +# define DPRINTF(fmt, ...) do { } while (0)
> > +#endif
> > +
> > +#if defined(__i386__)
> > +# define MAX_MCACHE_SIZE 0x40000000 /* 1GB max for x86 */
> > +# define MCACHE_BUCKET_SHIFT 16
> > +#elif defined(__x86_64__)
> > +# define MAX_MCACHE_SIZE 0x1000000000 /* 64GB max for x86_64 */
> > +# define MCACHE_BUCKET_SHIFT 20
> > +#endif
> > +#define MCACHE_BUCKET_SIZE (1UL<< MCACHE_BUCKET_SHIFT)
> >
>
> This is pretty awful. Set limits based on host address with, not based
> on i386 vs. x86_64.
Good point, actually we found a bug recently because of this.
We should choose the mapcache size depending on RLIMIT_AS.