From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756891AbZHNWRp (ORCPT ); Fri, 14 Aug 2009 18:17:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756763AbZHNWRo (ORCPT ); Fri, 14 Aug 2009 18:17:44 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:39261 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756747AbZHNWRn (ORCPT ); Fri, 14 Aug 2009 18:17:43 -0400 To: Amerigo Wang Cc: linux-kernel@vger.kernel.org, tony.luck@intel.com, linux-ia64@vger.kernel.org, linux-mm@kvack.org, Neil Horman , Andi Kleen , akpm@linux-foundation.org, bernhard.walle@gmx.de, Fenghua Yu , Ingo Molnar , Anton Vorontsov References: <20090812081731.5757.25254.sendpatchset@localhost.localdomain> <20090812081906.5757.39417.sendpatchset@localhost.localdomain> <4A83893D.50707@redhat.com> <4A83CD84.8040609@redhat.com> From: ebiederm@xmission.com (Eric W. Biederman) Date: Fri, 14 Aug 2009 15:17:34 -0700 In-Reply-To: <4A83CD84.8040609@redhat.com> (Amerigo Wang's message of "Thu\, 13 Aug 2009 16\:23\:32 +0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-XM-SPF: eid=;;;mid=;;;hst=in01.mta.xmission.com;;;ip=76.21.114.89;;;frm=ebiederm@xmission.com;;;spf=neutral X-SA-Exim-Connect-IP: 76.21.114.89 X-SA-Exim-Rcpt-To: amwang@redhat.com, avorontsov@ru.mvista.com, mingo@elte.hu, fenghua.yu@intel.com, bernhard.walle@gmx.de, akpm@linux-foundation.org, andi@firstfloor.org, nhorman@redhat.com, linux-mm@kvack.org, linux-ia64@vger.kernel.org, tony.luck@intel.com, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-DCC: XMission; sa04 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Amerigo Wang X-Spam-Relay-Country: X-Spam-Report: * -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 T_TM2_M_HEADER_IN_MSG BODY: T_TM2_M_HEADER_IN_MSG * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa04 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 XM_SPF_Neutral SPF-Neutral * 0.4 UNTRUSTED_Relay Comes from a non-trusted relay Subject: Re: [Patch 8/8] kexec: allow to shrink reserved memory X-SA-Exim-Version: 4.2.1 (built Thu, 25 Oct 2007 00:26:12 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Amerigo Wang writes: > Not that simple, marking it as "__init" means it uses some "__init" data which > will be dropped after initialization. If we start with the assumption that we will be reserving to much and will free the memory once we know how much we really need I see a very simple way to go about this. We ensure that the reservation of crash kernel memory is done through a normal allocation so that we have struct page entries for every page. On 32bit x86 that is an extra 1MB for a 128MB allocation. Then when it comes time to release that memory we clear whatever magic flags we have on the page (like PG_reserve) and call free_page. Eric