From: Ian Campbell Subject: Re: [patch] kexec is not highmem-aware Date: Mon, 18 Jun 2007 16:11:50 +0100 Message-ID: <1182179510.6283.65.camel@localhost.localdomain> References: <1182176957.21966.9.camel@sisko.scot.redhat.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1182176957.21966.9.camel@sisko.scot.redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Stephen C. Tweedie" Cc: "xen-devel@lists.xensource.com" , Gerd Hoffmann List-Id: xen-devel@lists.xenproject.org On Mon, 2007-06-18 at 15:29 +0100, Stephen C. Tweedie wrote: > The problem is in kimage_alloc_pages(), which tries to return contiguous > pages by calling > > xen_create_contiguous_region((unsigned long)page_address(pages), > order, address_bits) > > on the pages allocated. Unfortunately, page_address() returns NULL for > highmem pages. So as soon as we try this on a page in the highmem heap, > we get the above OOPS. The intention of this call is actually to ensure that the MFNs are below the limit imposed by the limit argument rather than to make a contiguous region so it is still required for order 0 allocations. Without this guarantee trying to load a crash kernel results in an OOM due to the check of mfn vs KEXEC_CONTROL_MEMORY_LIMIT in kimage_alloc_normal_control_pages(). There is similar check vs KEXEC_SOURCE_MEMORY_LIMIT in kimage_alloc_page(). It's possible (even likely with large hosts) for a domain to have no pages which satisfy these constraints so without the xen_create_contiguous_region it sucks up all memory and OOMs. This was introduced with xen-unstable.hg 14372:a1daade92952 I guess xen_create_contiguous_region is happy to operate on a temporarily kmapped page which are immediately unmapped since we only care that the MFN has been moved below the limit. Ian.