Hi, I''m using Xen 4.1.1-rc1-pre on linux-xen-2.6.32.39-g057b171. I''m trying to use memory sharing functions. In my code i call, uint64_t shandle, chandle; xc_memshr_nominate_gfn(xc_handle,dom1,4200,&shandle); //dom1 & dom2 are Debian Squeeze domUs xc_memshr_nominate_gfn(xc_handle,dom2,4200,&shandle); // gfn 4200 is a memory page in kernel code segment xc_memshr_share(xc_handle, shandle, chandle); I use xl dmesg and following is the output. (XEN) sh error: sh_remove_all_mappings(): can''t find all mappings of mfn 42f01: c=8000000000000002 t=8400000000000001 (XEN) sh error: sh_remove_all_mappings(): can''t find all mappings of mfn 42f01: c=8000000000000002 t=8400000000000001 (XEN) sh error: sh_remove_all_mappings(): can''t find all mappings of mfn 9c502: c=8000000000000002 t=8400000000000001 (XEN) sh error: sh_remove_all_mappings(): can''t find all mappings of mfn 42f02: c=8000000000000002 t=8400000000000001 (XEN) sh error: sh_remove_all_mappings(): can''t find all mappings of mfn 42f02: c=8000000000000002 t=8400000000000001 (XEN) printk: 2695593 messages suppressed. (XEN) mm.c:907:d1 Error getting mfn 9c625 (pfn fffffffffffffffe) from L1 entry 000000009c625021 for l1e_owner=1, pg_owner=1 (XEN) printk: 2768333 messages suppressed. After this operations the cpu usage of domUs goes to 97-100% and I can''t shutdown them. So when i issue "xl destroy""the system reboots. What could be the reason? Any help greatly appreciated. Thanks, Harshan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
At 08:17 +0100 on 24 May (1306225059), Lakshitha Harshan wrote:> Hi, > > I''m using Xen 4.1.1-rc1-pre on linux-xen-2.6.32.39-g057b171. I''m trying to use memory sharing functions. In my code i call, > > uint64_t shandle, chandle; > xc_memshr_nominate_gfn(xc_handle,dom1,4200,&shandle); //dom1 & dom2 are Debian Squeeze domUs > xc_memshr_nominate_gfn(xc_handle,dom2,4200,&shandle); // gfn 4200 is a memory page in kernel code segment > xc_memshr_share(xc_handle, shandle, chandle); > > I use xl dmesg and following is the output. > > (XEN) sh error: sh_remove_all_mappings(): can''t find all mappings of mfn 42f01: c=8000000000000002 t=8400000000000001 > (XEN) sh error: sh_remove_all_mappings(): can''t find all mappings of mfn 42f01: c=8000000000000002 t=8400000000000001 > (XEN) sh error: sh_remove_all_mappings(): can''t find all mappings of mfn 9c502: c=8000000000000002 t=8400000000000001 > (XEN) sh error: sh_remove_all_mappings(): can''t find all mappings of mfn 42f02: c=8000000000000002 t=8400000000000001 > (XEN) sh error: sh_remove_all_mappings(): can''t find all mappings of mfn 42f02: c=8000000000000002 t=8400000000000001 > (XEN) printk: 2695593 messages suppressed. > (XEN) mm.c:907:d1 Error getting mfn 9c625 (pfn fffffffffffffffe) from L1 entry 000000009c625021 for l1e_owner=1, pg_owner=1 > (XEN) printk: 2768333 messages suppressed. > > After this operations the cpu usage of domUs goes to 97-100% and I can''t shutdown them. So when i issue "xl destroy""the system reboots. > > What could be the reason? Any help greatlyMemory sharing is only supportes with HAP (that is, you must have a CPU with NPT or EPT support, and not have "hap=0" in your VM configuration file). The reboot is unfortunate; there should really be a more graceful failure mode if memory sharing is turned on with shadow pagetables. Tim. -- Tim Deegan <Tim.Deegan@citrix.com> Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi, This is regarding memory page sharing. I traced the code for page_sharing_nominate. But couldn''t find the exact location which requires HAP. So if somebody could tell me the location it would be a great help for me. My other questions are, I don''t understand the role HAP plays in page sharing? Why can''t we use the shadow page tables with page sharing? Please help. Thanks, Harshan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
At 09:15 +0530 on 01 Jun (1306919734), Lakshitha Harshan wrote:> This is regarding memory page sharing. > I traced the code for page_sharing_nominate. But couldn''t find the exact > location > which requires HAP. So if somebody could tell me the location it would be a > great help for me.Grrr, it doesn''t look like there is a test. :( I''ll add one.> My other questions are, > I don''t understand the role HAP plays in page sharing? > Why can''t we use the shadow page tables with page sharing?Briefly: because nobody did the work to make it happen. The shadow pagetable code would need to be updated to deal with the p2m code telling it that a page was shared (possibly just reporting a pagefault as fixed would do). I think it would also need a check that an in-use top-level pagetable could never be shared or paged out, and I''m sure there would be a few more bugs here and there. It''s possible that once Olaf and Keir have finished with the code to suspend a vcpus in mid-action, the shadow pagetable code will just work[tm] with memory sharing. Cheers, Tim. -- Tim Deegan <Tim.Deegan@citrix.com> Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi, Is there a way to find out the amount of memory shared in-between domUs? Thanks, Harshan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
At 10:34 +0530 on 14 Jun (1308047652), Lakshitha Harshan wrote:> Hi, > > Is there a way to find out the amount of memory shared in-between domUs?XENMEM_get_sharing_freed_pages will get you the total saving from sharing. I don''t think there''s a per-VM equivalent. Tim. -- Tim Deegan <Tim.Deegan@citrix.com> Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi,er I am playing with memory sharing functions (nominate & share), for my research project. In my project, i get the GFNs of starting & ending pages of kernel code segment using xc_translate_foreign_address and then using a loop i nominate the memory pages of kernel code segment & share them. Both nominate & share() functions returns 0, on most sharing requests (almost 99%). My problem is that after sharing the memory, all of the other domUs except the domU which is used for getting the handles (shandles) for sharing memory pages are frozen, if i start one VM after another and try to share code pages after VMs have logged in. If i try to run the same procedure on already started set of guest domains, the VMs will be restarted (except the shandle domU). So what could be the reason for this? I''m using Xen -4.1.1-rc3-pre. Thanks, Harshan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi, Harshan; The share() in mem_sharing.c doesn''t check if the content two pages (handles) are the same. The function simply drop the 2nd one (client handle), and that''s why you got all VMs crash except the domU which is used for getting the handles (shandles). You have to use memcmp or some other way in share() function to make sure they are actually the same. Bests, Jui-Hao On Thu, Jun 16, 2011 at 10:15 AM, Lakshitha Harshan <harshan.dll@gmail.com> wrote:> Hi,er > > I am playing with memory sharing functions (nominate & share), for my > research project. In my project, i get the GFNs of starting & ending > pages of kernel code segment using xc_translate_foreign_address and > then using a loop i nominate the memory pages of kernel code segment & > share them. > > Both nominate & share() functions returns 0, on most sharing requests > (almost 99%). > My problem is that after sharing the memory, all of the other domUs > except the domU which is used for getting the handles (shandles) for > sharing memory pages are frozen, if i start one VM after another and > try to share code pages after VMs have logged in. If i try to run the > same procedure on already started set of guest domains, the VMs will > be restarted (except the shandle domU). > > So what could be the reason for this? > I''m using Xen -4.1.1-rc3-pre. > > Thanks, > Harshan > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel