Xu, Anthony
2006-Aug-31 05:38 UTC
[Xen-devel][IPF][RFC] Error (12, ''Cannot allocate memory'') when creating domain
Hi all, When I create domain, XEN may complain Error (12, ''Cannot allocate memory'') even though there are plenty of memory available. I think kangkang had reported this bug. After investigation, I found this is caused by copy_to_guest. Dom0 calls increase_reservation hypercall to allocate memory for domain. At the end of this function, it will copy all mfns to guest address space. /* Inform the domain of the new page''s machine address. */ if ( !guest_handle_is_null(extent_list) ) { mfn = page_to_mfn(page); if ( unlikely(__copy_to_guest_offset(extent_list, i, &mfn, 1)) ) return i; } But __copy_to_guest_offset may fail in ia64 side, due to XEN may not record this tlb. Yes, increase_reservation function implements ''retry mechanism'', it hopes dom0 will call it again from the failure point. But dom0 didn''t use this ''retry mechanism'', dom0 thought this hypercall fail, and dom0 reported mistakenly Error (12, ''Cannot allocate memory'') Thanks, Anthony _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel