From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F6ADC38A02 for ; Fri, 28 Oct 2022 17:06:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB3BC6B0073; Fri, 28 Oct 2022 13:06:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B63116B0074; Fri, 28 Oct 2022 13:06:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A517A6B0075; Fri, 28 Oct 2022 13:06:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 962DD6B0073 for ; Fri, 28 Oct 2022 13:06:15 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 31F3D1612E2 for ; Fri, 28 Oct 2022 17:06:15 +0000 (UTC) X-FDA: 80070986310.29.6B859F8 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf24.hostedemail.com (Postfix) with ESMTP id 0BC47180043 for ; Fri, 28 Oct 2022 17:06:07 +0000 (UTC) Received: from zn.tnic (p200300ea9733e7ce329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7ce:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 2027D1EC0676; Fri, 28 Oct 2022 19:06:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1666976765; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=UpitehZpLYGjIwKABq3amz3Mj5g5BAkI3R/OCX9YIGU=; b=sYaqnLEfiGpccG69Zo0DHQ8p82KZKaS9i7HHJxG1ytsE2O6MRw9p46NNgIzbmM8HV7b4Wh aDsWDGjCtw54+5Ag2KuMSALI2dA70QKjaOXaHGWQmTKnu2gNxUBncbpmflVX7+4m8keEFE Lbb2fSANN7sbNULJMbKglClTrthTZcY= Date: Fri, 28 Oct 2022 19:06:01 +0200 From: Borislav Petkov To: Eric DeVolder Cc: Baoquan He , david@redhat.com, Oscar Salvador , Andrew Morton , linux-kernel@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org, ebiederm@xmission.com, dyoung@redhat.com, vgoyal@redhat.com, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, hpa@zytor.com, nramas@linux.microsoft.com, thomas.lendacky@amd.com, robh@kernel.org, efault@gmx.de, rppt@kernel.org, sourabhjain@linux.ibm.com, linux-mm@kvack.org Subject: Re: [PATCH v12 7/7] x86/crash: Add x86 crash hotplug support Message-ID: References: <53aed03e-2eed-09b1-9532-fe4e497ea47d@oracle.com> <35c98ca6-10f8-b248-78c5-99fce7e66c65@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666976774; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UpitehZpLYGjIwKABq3amz3Mj5g5BAkI3R/OCX9YIGU=; b=woc+P94al9524RfQTuNpWpaaww6cPzLQjc8/lFfMz0tFfDmhJRVWQ9EqVP8P7SXRiSJA28 KYtCLlqTXRHF8V0/RNlkpsMK5ngGbzeiZlUTu1bT5gRxxx7r6P7LlOf5W2PZhBM0RJh1Ar I9J66WgiMpd6PrQlTh1O4Db0eiPfxQE= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=temperror ("DNS error when getting key") header.d=alien8.de header.s=dkim header.b=sYaqnLEf; spf=temperror (imf24.hostedemail.com: error in processing during lookup of bp@alien8.de: DNS error) smtp.mailfrom=bp@alien8.de; dmarc=temperror reason="SPF/DKIM temp error" header.from=alien8.de (policy=temperror) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666976774; a=rsa-sha256; cv=none; b=bKFzr/YofUNFJSGH7CYZLt8W+Sz7P5sIJ5z6KysOFpfkTA4eB0FWc95PLAdSRVz57YmBvF 9Wx2h9PvCrZI6RROKmwwy6vlyTPFnlXVZD0p8bc+KfPnN4YG/GLdGbi/jIi2+xgUcrkU8f PcOP+GXBf8PCAQliXlljKFaMfTtcMuQ= Authentication-Results: imf24.hostedemail.com; dkim=temperror ("DNS error when getting key") header.d=alien8.de header.s=dkim header.b=sYaqnLEf; spf=temperror (imf24.hostedemail.com: error in processing during lookup of bp@alien8.de: DNS error) smtp.mailfrom=bp@alien8.de; dmarc=temperror reason="SPF/DKIM temp error" header.from=alien8.de (policy=temperror) X-Rspam-User: X-Rspamd-Queue-Id: 0BC47180043 X-Rspamd-Server: rspam03 X-Stat-Signature: 18smcmqnp8z9nsboeuogjq5igaptnzsx X-HE-Tag: 1666976767-557119 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000015, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Oct 28, 2022 at 10:29:45AM -0500, Eric DeVolder wrote: > So it is with this in mind that I suggest we stay with the statically sized elfcorehdr buffer. > > If that can be agreed upon, then it is "just a matter" of picking a useful > elfcorehdr size. Currently that size is derived from the NR_DEFAULT_CPUS and > CRASH_MAX_MEMORY_RANGES. So, there is still the CRASH_MAX_MEMORY_RANGES knob > to help a dial in size, should there be some issue with the default > value/size. Let's see kbuf.memsz = (CONFIG_NR_CPUS_DEFAULT + CONFIG_CRASH_MAX_MEMORY_RANGES) * sizeof(Elf64_Phdr); which, IINM, is (8192 + 32768) * 56 which is something like 2M. (CONFIG_NR_CPUS_DEFAULT = 8192 - this is because of MAXSMP which gets set on distro kernels) Now, since userspace kexec tools uses 2048 for max memory ranges, that size becomes smaller - around half a Mb. And since y'all wanna be on the safe side, you can quadruple it and have (8192 + 8192) * 56 which is still under a megabyte. And that's fine, I guess, on a big server. > Or if there is desire to drop computing the size from NR_DEFAULT_CPUs and I think you should leave the dependency on the Kconfig size so that smaller machines which are configured this way, don't end up wasting unnecessary memory. > It is my intention to correct the CRASH_MAX_MEMORY_RANGES (if we keep it) as such: > > config CRASH_MAX_MEMORY_RANGES > depends on CRASH_DUMP && KEXEC_FILE && MEMORY_HOTPLUG Yes, but don't leave it to the user to decide what number to choose - choose a high enough number, explain why you've chosen this with a comment and that's it. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette