Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-devel

[Xen-devel][IPF][RFC] Error (12, 'Cannot allocate memory') when creatin

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, "Alex Williamson" <alex.williamson@xxxxxx>
Subject: [Xen-devel][IPF][RFC] Error (12, 'Cannot allocate memory') when creating domain
From: "Xu, Anthony" <anthony.xu@xxxxxxxxx>
Date: Thu, 31 Aug 2006 13:38:17 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 30 Aug 2006 22:38:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcbMv6lKqEuePeWSQS6RdFq+XMdYkA==
Thread-topic: [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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel][IPF][RFC] Error (12, 'Cannot allocate memory') when creating domain, Xu, Anthony <=