[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Why frontswap and cleancache make copies in tmem?


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Jinchun Kim <cienlux@xxxxxxxxx>
  • Date: Sun, 16 Feb 2014 16:14:17 -0600
  • Delivery-date: Sun, 16 Feb 2014 22:14:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Hi, All.

While I was digging tmem and its source code, I found suspicious things about frontswap and cleancache.
When the guest OS wants to evict either a dirty or clean page, frontswap and cleancache will store it in tmem.
The linux kernel document tells that 

[Documentation/vm/frontswap.txt]
A “store” will copy the page to transcendent memory ….
A “load” will copy the page, if found, from transcendent memory into kernel memory ...

[Documentation/vm/cleancache.txt]
A “put_page” will copy a page (presumably about-to-be-evicted) page into cleancache ...
A “get_page” will copy the page, if found, from cleancache into kernel memory ...

My colleagues and I think copying the page is not necessary (especially for cleancache) because both kernel memory and tmem have same data. Why don’t we just change the pointer to the page and let it belong to tmem? We were wondering if there is any specific reason not to copy the pages to tmem.

Thanks.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.