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

[Xen-devel] how to know which file a memory page belongs to?


  • To: xen-devel@xxxxxxxxxxxxx
  • From: 谢雄炜 <xiexw24@xxxxxxxxx>
  • Date: Mon, 18 Mar 2013 14:47:11 -0400
  • Delivery-date: Mon, 18 Mar 2013 18:47:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>


Hi, all,

I'm a student. I want to use Xen to do some test about the relationship between memory and file in virtual machine.
In domain 0 or Xen, how can I know which file (in domain X) a memory page belongs to? 

For example, in Linux.

if i get the struct page of a 4k page, I can know which file it belongs to if it's a file memory cache.

if(unlikely(PageSwapCache(page)))
... ///(a swap cache)
else if ((unsigned long)page->mapping & PAGE_MAPPING_ANON)
...///(an anonymous page)
else
...  page->mapping->host ( I can get the inode of the file which this page belongs to.)


Can I achieve this in Xen through revise the code?
Thanks.

Best,
Wait
_______________________________________________
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®.