Re: [Xen-devel] Re: [RFC PATCH 0/4] (Take 2): transcendent memory("tmem") for Linux

From: Anthony Liguori
Date: Wed Jul 08 2009 - 20:28:03 EST


Jeremy Fitzhardinge wrote:
On 07/08/09 16:57, Anthony Liguori wrote:
Why does tmem require a special store?

A VMM can trap write operations pages can be stored on disk
transparently by the VMM if necessary. I guess that's the bit I'm
missing.

tmem doesn't store anything to disk. It's more about making sure that
free host memory can be quickly and efficiently be handed out to guests
as they need it; to increase "memory liquidity" as it were. Guests need
to explicitly ask to use tmem, rather than having the host/hypervisor
try to intuit what to do based on access patterns and hints; typically
they'll use tmem as the first line storage for memory which they were
about to swap out anyway.

If the primary use of tmem is to avoid swapping when measure pressure would have forced it, how is this different using ballooning along with a shrinker callback?

With virtio-balloon, a guest can touch any of the memory it's ballooned to immediately reclaim that memory. I think the main difference with tmem is that you can also mark a page as being volatile. The hypervisor can then reclaim that page without swapping it (it can always reclaim memory and swap it) and generate a special fault to the guest if it attempts to access it.

You can fail to put with tmem, right? You can also fail to get? In both cases though, these failures can be handled because Linux is able to recreate the page on it's on (by doing disk IO). So why not just generate a special fault instead of having to introduce special accessors?

Regards,

Anthony Liguori
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/