From patchwork Tue Sep 24 18:34:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Yanfei X-Patchwork-Id: 2935331 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 68ADB9F524 for ; Tue, 24 Sep 2013 18:35:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E39220444 for ; Tue, 24 Sep 2013 18:35:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C31920429 for ; Tue, 24 Sep 2013 18:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753449Ab3IXSfG (ORCPT ); Tue, 24 Sep 2013 14:35:06 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:37550 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732Ab3IXSfE (ORCPT ); Tue, 24 Sep 2013 14:35:04 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb1so4065719pad.37 for ; Tue, 24 Sep 2013 11:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Gfja+H50W564qyUXECunmr5FP6kJ7aVwA3n5vpqowMY=; b=dWIZhrRXWKPzw7cNKOJoBFfXSuoUradrtBh7bTpVEbuT6odKcwvCaGiCIlmNiyfuKE APqqjFeFJ8A7jsLC6ZUTld81hFUMx0a6GmcqRgaqBIh2/STvq7J5jj8D+X77etOfKEti OsIO0jtcOfAPhz6gbBaLHL3dAcMAn8n2xI8MqM2LbYKWZkydHWYLt3d5c+jnq72PRe8L EYNABahsYVushr52XAJhJabPD6LUElvp4WIjwXRNC+QAuMtIVGH5c+PnxQ90eToTUqNA zVwS3VDIR9vlLV+PKeCEirzGMoNxmId30BRu0175ANiHoCVn2epLHzJs29mdhl1ZJhN4 ykHQ== X-Received: by 10.66.149.231 with SMTP id ud7mr30197184pab.8.1380047703414; Tue, 24 Sep 2013 11:35:03 -0700 (PDT) Received: from localhost.localdomain ([222.95.211.254]) by mx.google.com with ESMTPSA id bt1sm42516972pbb.2.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Sep 2013 11:35:03 -0700 (PDT) Message-ID: <5241DB3A.6090002@gmail.com> Date: Wed, 25 Sep 2013 02:34:34 +0800 From: Zhang Yanfei User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120607 Thunderbird/10.0.5 MIME-Version: 1.0 To: "Rafael J . Wysocki" , lenb@kernel.org, Thomas Gleixner , mingo@elte.hu, "H. Peter Anvin" , Andrew Morton , Tejun Heo , Toshi Kani , Wanpeng Li , Thomas Renninger , Yinghai Lu , Jiang Liu , Wen Congyang , Lai Jiangshan , isimatu.yasuaki@jp.fujitsu.com, izumi.taku@jp.fujitsu.com, Mel Gorman , Minchan Kim , mina86@mina86.com, gong.chen@linux.intel.com, vasilis.liaskovitis@profitbricks.com, lwoodman@redhat.com, Rik van Riel , jweiner@redhat.com, prarit@redhat.com CC: "x86@kernel.org" , linux-doc@vger.kernel.org, "linux-kernel@vger.kernel.org" , Linux MM , linux-acpi@vger.kernel.org, imtangchen@gmail.com, Zhang Yanfei Subject: [PATCH v5 5/6] x86, acpi, crash, kdump: Do reserve_crashkernel() after SRAT is parsed References: <5241D897.1090905@gmail.com> In-Reply-To: <5241D897.1090905@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tang Chen Memory reserved for crashkernel could be large. So we should not allocate this memory bottom up from the end of kernel image. When SRAT is parsed, we will be able to know whihc memory is hotpluggable, and we can avoid allocating this memory for the kernel. So reorder reserve_crashkernel() after SRAT is parsed. Acked-by: Tejun Heo Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- arch/x86/kernel/setup.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index f0de629..36cfce3 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1120,8 +1120,6 @@ void __init setup_arch(char **cmdline_p) acpi_initrd_override((void *)initrd_start, initrd_end - initrd_start); #endif - reserve_crashkernel(); - vsmp_init(); io_delay_init(); @@ -1136,6 +1134,12 @@ void __init setup_arch(char **cmdline_p) initmem_init(); memblock_find_dma_reserve(); + /* + * Reserve memory for crash kernel after SRAT is parsed so that it + * won't consume hotpluggable memory. + */ + reserve_crashkernel(); + #ifdef CONFIG_KVM_GUEST kvmclock_init(); #endif