[Tmem-devel] tmem how to get current usage in megabytes?

Dan Magenheimer dan.magenheimer at oracle.com
Wed Aug 18 15:48:24 PDT 2010


> On Wed, 2010-08-18 at 15:28 -0700, Dan Magenheimer wrote:
> > > > I would first try increasing the size of your guest
> > > > swap disk (or, if easier, adding a second much larger
> > > > swap disk) to see if it helps.
> >
> > By the way, note that a second swap disk can be a large
> > size to the guest but, if your dom0 distro supports it,
> > can be backed with a sparse file.  If frontswap doesn't
> > "fill up", the backend sparse swapfile will rarely be
> > used.
> 
> What i need to support sparse swa files? I can create sparse file and
> do
> mkswap, but swapon command says that file has holes and do nothing.

I've not done this myself (since I don't have a machine
with large physical memory so I don't need a big swapdisk),
but I think the trick is to create the sparse disk in dom0
with dd, pass it to the guest as a second virtual hard
disk, then do the mkswap inside the guest.

http://prefetch.net/blog/index.php/2009/07/05/creating-sparse-files-on-linux-hosts-with-dd/ 

> > > > There are also a number of "tunables" for selfballooning
> > > > and frontswap-selfshrinking that can be adjusted in
> > > > /sys/devices/system/xen_memory/xen_memory0/*
> > > > including a min_target_kb that will limit the lower
> > > > limit that selfballooning will target.
> > >
> > > I think we use various versions of patches becouse i do not have
> > > min_target_kb , but have target_kb, if i try to write small value -
> > > memory is shrinking. But You say, that the current version of patch
> do
> > > the shrinking automatik in kernel, where i can find this version of
> > > patch?
> >
> > The patch you sent me has min_target_kb (search for
> > it in the patch) and does selfballooning in the kernel.
> > Maybe you are not running the kernel you built?  Or
> > maybe you did not enable CONFIG_XEN_SELFBALLOONING
> > when you built it?
> 
> It enabled like frontswap and cleancache.

hmmm... well if you look at the patch, those sys files
(including min_target_kb and selfballooning) should be created.

> > > I think i have mistake in my patch. Can you check my patch that i
> send?
> >
> > I looked it over quickly and it looked OK to me.  There
> > is a bug fix or two I've made on top of RHEL6 beta2, but
> > haven't yet applied it to the various beta2 updates that
> > Red Hat has already made (and I'm falling further behind).
> 
> I found some mistakes in other patches (i'm use opensuse for tests and
> it have many xen related patches and tmem patch of older version when i
> use), i'm try to remove unused parts of patches and compile it now...

OK, let me know how it goes.

Thanks,
Dan



More information about the Tmem-devel mailing list