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 31C2FFA3740 for ; Thu, 27 Oct 2022 13:52:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 865A38E0003; Thu, 27 Oct 2022 09:52:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 814598E0001; Thu, 27 Oct 2022 09:52:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DC3D8E0003; Thu, 27 Oct 2022 09:52:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5F8E88E0001 for ; Thu, 27 Oct 2022 09:52:29 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 28DD71C6A7A for ; Thu, 27 Oct 2022 13:52:29 +0000 (UTC) X-FDA: 80066869218.03.E6365AB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 9A62B2002C for ; Thu, 27 Oct 2022 13:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666878747; 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=J3Fq153B9PaKBw4UwH16xPw9HcajjAUr3ziTEO7//xc=; b=i0fZ9H/VN0NCfDQeh3kwUFgsVilXjUVXuWUP31Fb22fZ3ydpYMvGixM5gvgphRuwjWB5d0 j+pNMJfx35H2ahK/3M8ShrQgGtOmsKdJj+ArRQurAE+876DperyLVUgm4zdsvgAYUKegyR XJTZ8Ot+KdcGCckNcY/J3T77CBqqC3o= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-58-rzb8YtayMOebD4r3zSmchA-1; Thu, 27 Oct 2022 09:52:24 -0400 X-MC-Unique: rzb8YtayMOebD4r3zSmchA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 646E32A59558; Thu, 27 Oct 2022 13:52:22 +0000 (UTC) Received: from localhost (ovpn-12-121.pek2.redhat.com [10.72.12.121]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8429F403162; Thu, 27 Oct 2022 13:52:08 +0000 (UTC) Date: Thu, 27 Oct 2022 21:52:04 +0800 From: Baoquan He To: David Hildenbrand , Borislav Petkov , Eric DeVolder Cc: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666878747; a=rsa-sha256; cv=none; b=Bqh83/5mj8tEdzCCvb77+gg6emMPA1/UvT2hmxwyvo5keU4OK10c7wiwsOqcyV6o0zmMfa lgsb0a3Qq4DvwofliH9okViK6KuhZQbrT/wbpbvo9S9VR/nR0ZPY58BgVw9gwfd9y/yTsO ItC4EXOzKBHc3VhqvRruRtw01FDfU60= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="i0fZ9H/V"; spf=pass (imf03.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666878747; 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=J3Fq153B9PaKBw4UwH16xPw9HcajjAUr3ziTEO7//xc=; b=ywa6yhWlMUO8UVjgIlVYKLtHVrboU2tXkGSfYM91iCdV/ZV/gXoH2GEatuFQ6fV4HfjMJL T0javAcpi6MfGdY2f8F3AMyVetJUxNpWOROr5Agqx2cBJx9fqopLrJF58cuoPi+H13F00c 3fiZOcqn0eyRfHkWVbYoO3pUkOgefuw= X-Rspamd-Queue-Id: 9A62B2002C X-Rspam-User: Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="i0fZ9H/V"; spf=pass (imf03.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Stat-Signature: 6hjir4is9fsei3h47d88hcqwwobqjqup X-HE-Tag: 1666878747-151787 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 10/26/22 at 04:54pm, David Hildenbrand wrote: > On 26.10.22 16:48, Baoquan He wrote: > > On 10/25/22 at 12:31pm, Borislav Petkov wrote: > > > On Thu, Oct 13, 2022 at 10:57:28AM +0800, Baoquan He wrote: > > > > The concern to range number mainly is on Virt guest systems. > > > > > > And why would virt emulate 1K hotpluggable DIMM slots and not emulate a > > > real machine? > > IIRC, ACPI only allows for 256 slots. PPC dlpar might provide more. > > > > > Well, currently, mem hotpug is an important feature on virt system to > > dynamically increase/shrink memory on the system. If only emulating real > > machine, it won't be different than bare metal system. > > > > IIRC, the ballon driver or virtio-mem feature can add memory board, e.g > > 1G, block size is 128M, 8 blocks added. When shrinking this 1G memory > > later, it will take best effort way to hot remove memory. Means if any > > memory block is occupied, it will be kept there. Finally we could only > > remove every second blocks, 4 blocks altogether. Then the left > > un-removed blocks will produce 4 separate memory regions. Like this, a > > virt guest could have many memory regions in kernel after memory > > being added/removed. > > > > If I am wrong, Please correct me, David. > > Yes, virtio-mem (but also PPC dlpar) can result in many individual memory > blocks with holes in between after hotunplug. Hotplug OTOH, usually tries to > "plug" these holes and reduce the total number of memory blocks. It might be > rare that our range will be heavily fragmented after unplug, but it's > certainly possible. > > [...] > > > > > Yes, now assume we have a HPE SGI system and it has memory hotplug > > capacity. The system itself has already got memory regions more than > > 1024. Then when we hot add extra memory board, we want to include the > > newly added memory regions into elfcorehdr so that it will be dumped out > > in kdump kernel. > > > > That's why I earlier suggested 2048 for number of memory regions. > > The more the better, unless "it hurts". Assuming a single memory block is > 128 MiB, that would be 256 GiB. > > Usually, on big systems, the memory block size is 2 GiB. So 4 TiB. Thanks a lot for these valuable inputs, David. Hi Boris, Eric So what's your suggested value for the Kconfig option? 1) cpu number, 1024? 2) memory regions, 2048? About below draft, any comment? We can decide a value based on our knowledge, can adjust later if any real system has more than the number. +config CRASH_ELF_CORE_PHDRS_NUM + depends on CRASH_DUMP && KEXEC_FILE && (HOTPLUG_CPU || MEMORY_HOTPLUG) + int + default 3072 + help + For the kexec_file_load path, specify the default number of + phdr for the vmcore. E.g the memory regions represented by the + 'System RAM' entries in /proc/iomem, the cpu notes of each + present cpu stored in /sys/devices/system/cpu/cpuX/crash_notes. Thanks Baoquan