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

Avi Kivity
2009-07-13T11:31:19Z

On 07/13/2009 12:08 AM, Dan Magenheimer wrote:
>> Can you explain how it differs for the swap case? Maybe I don't
>> understand how tmem preswap works.
>>
>
> The key differences I see are the "please may I store something"
> API and the fact that the reply (yes or no) can vary across time
> depending on the state of the collective of guests. Virtual
> disk cacheing requires the host to always say yes and always
> deliver persistence.

We need to compare tmem+swap to swap+cache, not just tmem to cache.
Here's how I see it:

tmem+swap swapout:
- guest copies page to tmem (may fail)
- guest writes page to disk

cached drive swapout:
- guest writes page to disk
- host copies page to cache

tmem+swap swapin:
- guest reads page from tmem (may fail)
- on tmem failure, guest reads swap from disk
- guest drops tmem page

cached drive swapin:
- guest reads page from disk
- host may satisfy read from cache

tmem+swap ageing:
- host may drop tmem page at any time

cached drive ageing:
- host may drop cached page at any time

So they're pretty similar. The main difference is that tmem can drop
the page on swapin. It could be made to work with swap by supporting
the TRIM command.

> I can see that this is less of a concern
> for KVM because the host can swap... though doesn't this hide
> information from the guest and potentially have split-brain
> swapping issues?
>

Double swap is bad for performance, yes. CMM2 addresses it nicely.
tmem doesn't address it at all - it assumes you have excess memory.

> (thanks for the great discussion so far... going offline mostly now
> for a few days)
>

I'm going offline too so it cancels out.

--
error compiling committee.c: too many arguments to function