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@lists.xen.org http://lists.xen.org/xen-devel
At 14:47 -0400 on 18 Mar (1363618031), ?????? wrote:> 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?Xen only allows dom0 to map domX''s memory; to decide what file domX associates a page with, you''ll need some code that can find and understand the kernel datastructures in domX''s memory. Have a look at https://code.google.com/p/vmitools/ as a starting point. Cheers, Tim.
Thank you for your help. I appreciate. Best, Wait 2013/3/21 Tim Deegan <tim@xen.org>> At 14:47 -0400 on 18 Mar (1363618031), ?????? wrote: > > 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? > > Xen only allows dom0 to map domX''s memory; to decide what file domX > associates a page with, you''ll need some code that can find and > understand the kernel datastructures in domX''s memory. Have a look at > https://code.google.com/p/vmitools/ as a starting point. > > Cheers, > > Tim. >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel