WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH] Balloon driver crash

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] Balloon driver crash
From: M A Young <m.a.young@xxxxxxxxxxxx>
Date: Tue, 8 Jun 2010 19:08:49 +0100 (BST)
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Dave McCracken <dcm@xxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Delivery-date: Tue, 08 Jun 2010 11:10:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C0E731E.8060308@xxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.GSO.2.00.1006031434080.4562@xxxxxxxxxxxxxxxx> <alpine.LFD.2.00.1006032028110.20613@xxxxxxxxxxxxxxx> <1275597402.2782.47.camel@xxxxxxxxxxxxxxxxxxxxx> <201006031738.15635.dcm@xxxxxxxx> <alpine.LFD.2.00.1006072027300.3888@xxxxxxxxxxxxxxx> <1275983765.24218.49851.camel@xxxxxxxxxxxxxxxxxxxxxx> <alpine.GSO.2.00.1006080927520.13054@xxxxxxxxxxxxxxxx> <1275986577.24218.49951.camel@xxxxxxxxxxxxxxxxxxxxxx> <alpine.GSO.2.00.1006081019000.13054@xxxxxxxxxxxxxxxx> <4C0E731E.8060308@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
On Tue, 8 Jun 2010, Jeremy Fitzhardinge wrote:

On 06/08/2010 02:25 AM, M A Young wrote:
This patch fixes an error in commit
f4685d0ed041523d1bd5124c5872459681aca876
"Add hugepage support to balloon driver" that was causing the balloon
driver to crash when shrinking the memory used by Domain-0.

Thanks.  But why haven't I seen this?

Good question, but I think you only see the crash in a limited memory situation. I don't claim to be an expert in what is going on, but a few lines earlier you have the the loop

        for (i = 0; i < nr_pages; i++) {
if ((page = alloc_pages(GFP_BALLOON, balloon_order)) == NULL) {
                        nr_pages = i;
                        need_sleep = 1;
                        break;
                }

                pfn = page_to_pfn(page);
                frame_list[i] = pfn_to_mfn(pfn);

                scrub_page(page);
        }

If alloc_pages(GFP_BALLOON, balloon_order) is never NULL during the loop then page is left set to be one of the pages you are freeing. From then on PageHighMem(pfn_to_page(lpfn)) and PageHighMem(page) could easily the same and you will only have a problem if some of the pages you are freeing are PageHighMem and some aren't.

If alloc_pages(GFP_BALLOON, balloon_order) is null somewhere in the loop (presumably because it can't find enough pages to free) then the process will crash.

        Michael Young

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel