Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2730718rwi; Fri, 28 Oct 2022 10:28:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7zA2Jjdykvg125gWbDBn6Ul0MDflB7OgwWY3l+gCns3bMxZdxekf9gZdQ/43ydgpnff/yN X-Received: by 2002:a17:90a:c78a:b0:212:e56b:2b17 with SMTP id gn10-20020a17090ac78a00b00212e56b2b17mr339570pjb.51.1666978135939; Fri, 28 Oct 2022 10:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666978135; cv=none; d=google.com; s=arc-20160816; b=dENAvY+zUCSY/CjsrE4g7uTE9N3I6vsB1p88AsCs1gZoykNC+r2Sa2gELRpNSqmMqf 7I5ymUZHMJAmH3iIKMsGAPx2N8krrYY/PIhgXpSPeRqvlLTZyST3AON6IQQb6foQwaD9 73nl3EeUdX96mpGar0OX2nm3zEwA38gydKUuKBTfrZwHnAVelnbS+qwny/iLPmNO074I E77OWdeS8vWUQUWsizqgXfUXzfyQnLufdeHujp7geVFVQQv6g/pjU/Jg7e0nIp7loaXs qvVWBXozXhEpxP570JCNrujXRD7dbsnfEOgHl3tzrc6n99Tk2y9K9qgDatqMw/LM40lS qchw== 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=UpitehZpLYGjIwKABq3amz3Mj5g5BAkI3R/OCX9YIGU=; b=BhHxAR5uDIKiuLf2aNUVgw1ixo9yAjaf4XaiXdZ/YVEFUNoC5iV00vb8+BwbrL9bXO DFuZ3IYDh+gbXmUzjlT9/3zzQpyuJhoL8bP51vsp+A0a1jxnrtTHs3QaO3z3OfugW+vI OM5YTNLzAXiCwitzBZuU/t6WNxT+4j8aA0TU7KUJN6TkVgDCzku6KntEj1YbTPKGuvDf pdFn4MR1HQRGCYM/jPgxak202QPuKPBX99D/LNNoOLeioxjiQSY0b3Xpg1pdeQsvhpRk AbJ4rh2eQMh6mmD6emoxjU692fg1gl+vV2GsGcQQQ9+cW1MDYF1xKLoSdKTTnC2wkeg3 iSSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=sYaqnLEf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j70-20020a638049000000b004600f27528fsi5848982pgd.175.2022.10.28.10.28.43; Fri, 28 Oct 2022 10:28:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=sYaqnLEf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231260AbiJ1RIi (ORCPT + 99 others); Fri, 28 Oct 2022 13:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230476AbiJ1RIU (ORCPT ); Fri, 28 Oct 2022 13:08:20 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95D6D237955 for ; Fri, 28 Oct 2022 10:06:17 -0700 (PDT) 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: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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