Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp938233pxb; Thu, 19 Nov 2020 18:31:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyY++4MzBcRLvbS1ULG8dOfeNCDzoFcpEFYw3gqW3Ho15GzHP1sTx/Xt4wKytwepySL3V2m X-Received: by 2002:a17:907:4270:: with SMTP id nx24mr4633905ejb.296.1605839501209; Thu, 19 Nov 2020 18:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605839501; cv=none; d=google.com; s=arc-20160816; b=UqVUtSW8YyUOXHWu8gB/c+vgU6pewts6MrxEbuLr6nbPMJtbXyi1lIMuziT+EkYSzK c07IvAgEaValCCIMVQh2uq5q6ySajiq1MJmhq5skdljzk0UhW63K7XAeOhOOgB05aKE3 ZnDnDMsRtyAb63gJ8PwviapebpKA1eVoCPtSpw/hgY8iaLkWSUJOX/ZxPnjqRHbLYSgc RYTYiFvna6zyhy6IARinDp3huk4lypXV/GWQD4OfeveZTaSFlt2kop+JaW0vGRB+69N4 9D0ec+MBafsRLbMj3uXNxhtpJe/Ul1qJUWKNuLwJq3mYq/dNatn6at0joaz43N1wbj1N FVEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4sxKhMof86hickCRVUEuAEtymNQnjon9Bfb0eSzoC34=; b=CHr7BHFrCTYVhUk9+vIYlCm16hC99FqSC2ZFKlrOvxFCjo3o5N5qsJztHxmo7oxXUM VtDXJYCOt/Dg1LeHACPes0de6rZWHUtLSrtxThVrMPI7bwB6e5awQBUJ5JPPMkRswMRq chK3/lLqVlCnDm4HK5HVdMpNa7Ua2kD8pWaMh+dtsjrtjhKFId+xzV3EXgLLfBZGIRhl Z43mxeMqRk/Y23SfPYFwJ89xKo2ynpNkUHPg3HYAIHKEac3GgmSlGAG6FtWSMIKtzN4a Qp4vJ1LiuSzCMoM3DbENvl7VuC+t2FnVMS2Qy8nQ/w1pSwpPDT6uGZd+asoBzXpqt9l9 Ulug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=inzSyg5C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e21si965577eds.259.2020.11.19.18.31.17; Thu, 19 Nov 2020 18:31:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=inzSyg5C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726314AbgKTC0u (ORCPT + 99 others); Thu, 19 Nov 2020 21:26:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:33802 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725937AbgKTC0t (ORCPT ); Thu, 19 Nov 2020 21:26:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605839207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4sxKhMof86hickCRVUEuAEtymNQnjon9Bfb0eSzoC34=; b=inzSyg5CEt/hJdFVUB8tvA/Rb8y2mPxGR66q5XyJDqe5Hn7OnDgC+R7YDjho3lGuQ2XKlD r4QJJIb3Jjcg2gBm+sFQrIDts0gXgc65V89dJcSkGtoManZP59i6RUpYf9zj2MOa+djB6J raLLD5Da6kmtjOKxQi4deeYBXZBp+kQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-588-sOa4YTahNv2t3MXF3bnYLw-1; Thu, 19 Nov 2020 21:26:43 -0500 X-MC-Unique: sOa4YTahNv2t3MXF3bnYLw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 12C6A180E46F; Fri, 20 Nov 2020 02:26:39 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-196.pek2.redhat.com [10.72.12.196]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2CAF110013BD; Fri, 20 Nov 2020 02:26:25 +0000 (UTC) Date: Fri, 20 Nov 2020 10:26:22 +0800 From: Dave Young To: Guilherme Piccoli Cc: Saeed Mirzamohammadi , Geert Uytterhoeven , linux-doc@vger.kernel.org, Catalin Marinas , Bjorn Andersson , "H. Peter Anvin" , Will Deacon , Anson Huang , Jonathan Corbet , x86@kernel.org, Michael Walle , Krzysztof Kozlowski , Ingo Molnar , Vivek Goyal , john.p.donnelly@oracle.com, Arnd Bergmann , Borislav Petkov , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Baoquan He , "Martin K. Petersen" , Randy Dunlap , kexec mailing list , LKML , "# v4 . 16+" , Li Yang , Miguel Ojeda , Vinod Koul , Diego Elio =?iso-8859-1?Q?Petten=F2?= , Olof Johansson , Shawn Guo , Thadeu Lima de Souza Cascardo , Dann Frazier Subject: Re: [PATCH 1/1] kernel/crash_core.c - Add crashkernel=auto for x86 and ARM Message-ID: <20201120022622.GA3731@dhcp-128-65.nay.redhat.com> References: <20201118232431.21832-1-saeed.mirzamohammadi@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guilherme, On 11/19/20 at 06:56pm, Guilherme Piccoli wrote: > Hi Saeed, thanks for your patch/idea! Comments inline, below. > > On Wed, Nov 18, 2020 at 8:29 PM Saeed Mirzamohammadi > wrote: > > > > This adds crashkernel=auto feature to configure reserved memory for > > vmcore creation to both x86 and ARM platforms based on the total memory > > size. > > > > Cc: stable@vger.kernel.org > > Signed-off-by: John Donnelly > > Signed-off-by: Saeed Mirzamohammadi > > --- > > Documentation/admin-guide/kdump/kdump.rst | 5 +++++ > > arch/arm64/Kconfig | 26 ++++++++++++++++++++++- > > arch/arm64/configs/defconfig | 1 + > > arch/x86/Kconfig | 26 ++++++++++++++++++++++- > > arch/x86/configs/x86_64_defconfig | 1 + > > kernel/crash_core.c | 20 +++++++++++++++-- > > 6 files changed, 75 insertions(+), 4 deletions(-) > > > > diff --git a/Documentation/admin-guide/kdump/kdump.rst b/Documentation/admin-guide/kdump/kdump.rst > > index 75a9dd98e76e..f95a2af64f59 100644 > > --- a/Documentation/admin-guide/kdump/kdump.rst > > +++ b/Documentation/admin-guide/kdump/kdump.rst > > @@ -285,7 +285,12 @@ This would mean: > > 2) if the RAM size is between 512M and 2G (exclusive), then reserve 64M > > 3) if the RAM size is larger than 2G, then reserve 128M > > > > +Or you can use crashkernel=auto if you have enough memory. The threshold > > +is 1G on x86_64 and arm64. If your system memory is less than the threshold, > > +crashkernel=auto will not reserve memory. The size changes according to > > +the system memory size like below: > > > > + x86_64/arm64: 1G-64G:128M,64G-1T:256M,1T-:512M > > As mentioned in the thread, this was tried before and never got merged > - I'm not sure the all the reasons, but I speculate that a stronger > reason is that it'd likely fail in many cases. I've seen cases of 256G Yes, there were a few tries, last time I tried to set a default value, I do not think people are strongly against it. We have been using the auto in Red Hat for long time, it does work for most of usual cases like Saeed said in the patch. But I think all of us are aligned it is not possible to satisfy all the user cases. Anyway I also think this is good to have. > servers that require crashkernel=600M (or more), due to the amount of > devices. Also, the minimum nowadays would likely be 96M or more - I'm > looping Cascardo and Dann (Debian/Ubuntu maintainers of kdump stuff) > so they maybe can jump in with even more examples/considerations. Another reason of people have different feeling about the memory requirement is currently distributions are doing different on kdump, especially for the userspace part. Kairui did a lot of work in dracut to reduce the memory requirements in dracut, for example only add dump required kernel modules in 2nd kernel initramfs, also we have a lot of other twicks for dracut to use "hostonly" mode, eg. hostonly multipath configurations will just bring up necessary paths instead of creating all of the multipath devices. > > What we've been trying to do in Ubuntu/Debian is using an estimator > approach [0] - this is purely userspace and tries to infer the amount > of necessary memory a kdump minimal[1] kernel would take. I'm not > -1'ing your approach totally, but I think a bit more consideration is > needed in the ranges, at least accounting the number of devices of the > machine or something like that. There are definitely room to improve and make it better in the future, but I think this is a good start and simple enough proposal for the time being :) > > Cheers, > > > Guilherme > > [0] https://salsa.debian.org/debian/makedumpfile/-/merge_requests/7 > [1] Minimal as having a reduced initrd + "shrinking" parameters (like > nr_cpus=1). > Thanks Dave