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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3405DC433F5 for ; Wed, 23 Feb 2022 03:25:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237459AbiBWDZ6 (ORCPT ); Tue, 22 Feb 2022 22:25:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230404AbiBWDZ4 (ORCPT ); Tue, 22 Feb 2022 22:25:56 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F3A6527CA for ; Tue, 22 Feb 2022 19:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645586728; 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=0YexfALl2Wt+vo+ZGpAgjDTpbBXv3xskm09mPqFwieQ=; b=GnzSZ+OkkjUaTSs3BQBlgqInJNrWtsF3DoQFeY7ZVhSLLgDED3NxQT2btxCUXHmRd7vNu/ c7aruo51gmFBNfBkyTQx14+s08LGsFbyhNrd0ytbT6Zv9/66GCesgG+aQ4ULEMeJMM4E7j +fJYflH6Zlk38aCxW9nYNxvDZk4wvQY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-639-sHoXl5fiNV-y26G_P-nA2A-1; Tue, 22 Feb 2022 22:25:27 -0500 X-MC-Unique: sHoXl5fiNV-y26G_P-nA2A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 79B16801AAD; Wed, 23 Feb 2022 03:25:24 +0000 (UTC) Received: from localhost (ovpn-14-1.pek2.redhat.com [10.72.14.1]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E3A684CECC; Wed, 23 Feb 2022 03:25:14 +0000 (UTC) Date: Wed, 23 Feb 2022 11:25:11 +0800 From: Baoquan He To: Eric DeVolder Cc: 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, bp@alien8.de, 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, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com Subject: Re: [PATCH v4 02/10] crash hp: Introduce CRASH_HOTPLUG configuration options Message-ID: References: <20220209195706.51522-1-eric.devolder@oracle.com> <20220209195706.51522-3-eric.devolder@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220209195706.51522-3-eric.devolder@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/09/22 at 02:56pm, Eric DeVolder wrote: > Support for CPU and memory hotplug for crash is controlled by the > CRASH_HOTPLUG configuration option, introduced by this patch. > > The CRASH_HOTPLUG_ELFCOREHDR_SZ related configuration option is > also introduced with this patch. > > Signed-off-by: Eric DeVolder > --- > arch/x86/Kconfig | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index ebe8fc76949a..4e3374edab02 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -2060,6 +2060,32 @@ config CRASH_DUMP > (CONFIG_RELOCATABLE=y). > For more details see Documentation/admin-guide/kdump/kdump.rst > > +config CRASH_HOTPLUG > + bool "kernel updates of crash elfcorehdr" > + depends on CRASH_DUMP && (HOTPLUG_CPU || MEMORY_HOTPLUG) && KEXEC_FILE > + help > + Enable the kernel to update the crash elfcorehdr (which contains > + the list of CPUs and memory regions) directly when hot plug/unplug > + of CPUs or memory. Otherwise userspace must monitor these hot > + plug/unplug change notifications via udev in order to > + unload-then-reload the crash kernel so that the list of CPUs and > + memory regions is kept up-to-date. Note that the udev CPU and > + memory change notifications still occur (however, userspace is not > + required to monitor for crash dump purposes). > + > +config CRASH_HOTPLUG_ELFCOREHDR_SZ > + depends on CRASH_HOTPLUG > + int > + default 131072 > + help > + Specify the maximum size of the elfcorehdr buffer/segment. > + The 128KiB default is sized so that it can accommodate 2048 > + Elf64_Phdr, where each Phdr represents either a CPU or a > + region of memory. > + For example, this size can accommodate hotplugging a machine > + with up to 1024 CPUs and up to 1024 memory regions (e.g. 1TiB > + with 1024 1GiB memory DIMMs). This example of memory could be a little misleading. The memory regions may not be related to memory DIMMs. System could split them into many smaller regions during bootup. Otherwise, this patch looks good to me. > + > config KEXEC_JUMP > bool "kexec jump" > depends on KEXEC && HIBERNATION > -- > 2.27.0 > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baoquan He Date: Wed, 23 Feb 2022 11:25:11 +0800 Subject: [PATCH v4 02/10] crash hp: Introduce CRASH_HOTPLUG configuration options In-Reply-To: <20220209195706.51522-3-eric.devolder@oracle.com> References: <20220209195706.51522-1-eric.devolder@oracle.com> <20220209195706.51522-3-eric.devolder@oracle.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kexec@lists.infradead.org On 02/09/22 at 02:56pm, Eric DeVolder wrote: > Support for CPU and memory hotplug for crash is controlled by the > CRASH_HOTPLUG configuration option, introduced by this patch. > > The CRASH_HOTPLUG_ELFCOREHDR_SZ related configuration option is > also introduced with this patch. > > Signed-off-by: Eric DeVolder > --- > arch/x86/Kconfig | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index ebe8fc76949a..4e3374edab02 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -2060,6 +2060,32 @@ config CRASH_DUMP > (CONFIG_RELOCATABLE=y). > For more details see Documentation/admin-guide/kdump/kdump.rst > > +config CRASH_HOTPLUG > + bool "kernel updates of crash elfcorehdr" > + depends on CRASH_DUMP && (HOTPLUG_CPU || MEMORY_HOTPLUG) && KEXEC_FILE > + help > + Enable the kernel to update the crash elfcorehdr (which contains > + the list of CPUs and memory regions) directly when hot plug/unplug > + of CPUs or memory. Otherwise userspace must monitor these hot > + plug/unplug change notifications via udev in order to > + unload-then-reload the crash kernel so that the list of CPUs and > + memory regions is kept up-to-date. Note that the udev CPU and > + memory change notifications still occur (however, userspace is not > + required to monitor for crash dump purposes). > + > +config CRASH_HOTPLUG_ELFCOREHDR_SZ > + depends on CRASH_HOTPLUG > + int > + default 131072 > + help > + Specify the maximum size of the elfcorehdr buffer/segment. > + The 128KiB default is sized so that it can accommodate 2048 > + Elf64_Phdr, where each Phdr represents either a CPU or a > + region of memory. > + For example, this size can accommodate hotplugging a machine > + with up to 1024 CPUs and up to 1024 memory regions (e.g. 1TiB > + with 1024 1GiB memory DIMMs). This example of memory could be a little misleading. The memory regions may not be related to memory DIMMs. System could split them into many smaller regions during bootup. Otherwise, this patch looks good to me. > + > config KEXEC_JUMP > bool "kexec jump" > depends on KEXEC && HIBERNATION > -- > 2.27.0 >