Received: by 10.223.164.202 with SMTP id h10csp2887300wrb; Sun, 12 Nov 2017 21:28:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMbQnwUUbz9bgPHLbf9q9b4Ihg+z3Y7kdKhWiqjw3BxiO4iO7d8CDIWB7KWgRHv8ncg0ds1u X-Received: by 10.98.242.15 with SMTP id m15mr8795750pfh.176.1510550900348; Sun, 12 Nov 2017 21:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510550900; cv=none; d=google.com; s=arc-20160816; b=jFZc7Fr1v7s3DM5OPjFtyG+liT1lMkDih6bbgiIHjeqDFnqg0iaMHJQlLwVcDypAQp IE+rzP6gTatAymLbFlnuL0ISWOvK8dPE/317rCyyPb2bQUbc555RAoi8POyb98sPieaO 6v9dPBKVTFkeKzmiFo3NdZSh4ygJ1eiqaUJA/O1L8LG4UVGTSlehZcFGIOQIlz497PN3 lA9GEoicXVp4sS2Uk+aiH60fhQplrSKG/QHKMN0QhjSnF33n4DiAJtkzIhzIlFJirmMu wk7EWnlfaHuiG1w9F2WALiF0OVmBwU5EtSm2toSchZyFfzR0nxe02H2opyfp9xXxDeEP hxBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=l0RoXHPf8/foXJPejUDu7iVmmjHEziYEUr8VDtQDcXU=; b=Oi36UHUqXxxFiReGHFiIZSiXaAAfwKrFtQHeDXU22gjdoOdNZjP7Gs4fx2xM0zlepl Sqtqp+5NbmH8efprlyKBcpeZ+EPGBtYOoi3SqZIjemat2bh6Hh0VzYgz5PDE55ftKi4K JD5vNNduTdkk0/DNxiQv0gwLVeutF4x8kxcEGG9F5OJp+IeErHMSl/J0QmEbaek/1MXT iKoHGT16cjNgNgREdDvwnQFsgmq7SZSWZFrcB7We8HRx2Sz1/t5r7YZI7c0wIZENaWV2 nDhbjVBgzMemuSSZxBhLYGgPyoEFhBUdFcQ3TnE/+xMl0ditm79UgU6CqMZuU0D2dIVY /l0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b29si14634044pfh.302.2017.11.12.21.28.08; Sun, 12 Nov 2017 21:28:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751924AbdKMF1U (ORCPT + 87 others); Mon, 13 Nov 2017 00:27:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751562AbdKMF1T (ORCPT ); Mon, 13 Nov 2017 00:27:19 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7578B81E01; Mon, 13 Nov 2017 05:27:19 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-30.pek2.redhat.com [10.72.12.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 817C4183C6; Mon, 13 Nov 2017 05:27:16 +0000 (UTC) Date: Mon, 13 Nov 2017 13:27:12 +0800 From: Dave Young To: kexec@lists.infradead.org, linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, bhe@redhat.com, vgoyal@redhat.com, yinghai@kernel.org, corbet@lwn.net Subject: Re: [PATCH 2/3] X86/kdump: crashkernel=X try to reserve below 896M first then below 4G and MAXMEM Message-ID: <20171113052712.GA4894@dhcp-128-65.nay.redhat.com> References: <20171024053901.757504190@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171024053901.757504190@redhat.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 13 Nov 2017 05:27:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/24/17 at 01:31pm, Dave Young wrote: > Now crashkernel=X will fail if there's not enough memory at low region > (below 896M) when trying to reserve large memory size. One can use > crashkernel=xM,high to reserve it at high region (>4G) but it is more > convinient to improve crashkernel=X to: > > - First try to reserve X below 896M (for being compatible with old > kexec-tools). > - If fails, try to reserve X below 4G (swiotlb need to stay below 4G). > - If fails, try to reserve X from MAXMEM top down. > > It's more transparent and user-friendly. > > If crashkernel is large and the reserved is beyond 896M, old kexec-tools > is not compatible with new kernel because old kexec-tools can not load > kernel at high memory region, there was an old discussion below: > https://lkml.org/lkml/2013/10/15/601 > > But actually the behavior is consistent during my test. Suppose > old kernel fail to reserve memory at low areas, kdump does not > work because no meory reserved. With this patch, suppose new kernel > successfully reserved memory at high areas, old kexec-tools still fail > to load kdump kernel (tested 2.0.2), so it is acceptable, no need to > worry about the compatibility. > > Here is the test result (kexec-tools 2.0.2, no high memory load > support): > Crashkernel over 4G: > # cat /proc/iomem|grep Crash > be000000-cdffffff : Crash kernel > 213000000-21effffff : Crash kernel > # ./kexec -p /boot/vmlinuz-`uname -r` > Memory for crashkernel is not reserved > Please reserve memory by passing "crashkernel=X@Y" parameter to the kernel > Then try loading kdump kernel > > crashkernel: 896M-4G: > # cat /proc/iomem|grep Crash > 96000000-cdefffff : Crash kernel > # ./kexec -p /boot/vmlinuz-4.14.0-rc4+ > ELF core (kcore) parse failed > Cannot load /boot/vmlinuz-4.14.0-rc4+ > > Signed-off-by: Dave Young > --- > arch/x86/kernel/setup.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > --- linux-x86.orig/arch/x86/kernel/setup.c > +++ linux-x86/arch/x86/kernel/setup.c > @@ -568,6 +568,22 @@ static void __init reserve_crashkernel(v > high ? CRASH_ADDR_HIGH_MAX > : CRASH_ADDR_LOW_MAX, > crash_size, CRASH_ALIGN); > +#ifdef CONFIG_X86_64 > + /* > + * crashkernel=X reserve below 896M fails? Try below 4G > + */ > + if (!high && !crash_base) > + crash_base = memblock_find_in_range(CRASH_ALIGN, > + (1ULL << 32), > + crash_size, CRASH_ALIGN); > + /* > + * crashkernel=X reserve below 4G fails? Try MAXMEM > + */ > + if (!high && !crash_base) > + crash_base = memblock_find_in_range(CRASH_ALIGN, > + CRASH_ADDR_HIGH_MAX, > + crash_size, CRASH_ALIGN); > +#endif > if (!crash_base) { > pr_info("crashkernel reservation failed - No suitable area found.\n"); > return; > > Andrew, this patch is good to have, could you take this in your tree? The other two patches may need more discussion I will drop them for now. Thanks Dave From 1582116369603180001@xxx Tue Oct 24 05:42:27 +0000 2017 X-GM-THRID: 1582116369603180001 X-Gmail-Labels: Inbox,Category Forums