From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBFA9606A31C for ; Fri, 27 Nov 2026 09:08:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=SuSS3Slv; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Wix8FG5B DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=Y/UMHkeyUCY25NbdTw5rz9oJMH9U+JYd8hruRProdo8=; b=SuSS3SlvleMrqHP2hOKqyJn5u7 Z8Uv77O8RjxLVQW1pmlhEgK6cCeYOYArogLcYWyTrmNKYI9VybNQVEd0UaUByRY2shMljLqtbi6y7 J5Xi8kcUChb5ey3kPudwtW7il1A5b2g1frUjuzWd65JygRg07C46jjmk8LyoNOqOW42MXP3I+rYVQ tzxJDIEegLRUx217PgRRa+uGpm0OBvrNrEFgYrnx8tDCEeMSCwGTbWEvT4WuGpdJLJHZVMVka/mJC MzzK57GO+OnunYWoJsVSMeAAHcYNepqDvBgrAWrLCre8WukVRqBwizTIX/txsDRU38yzog58VVfpz f1ugKvpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWrvl-0000000FM3F-0ZPZ; Fri, 27 Nov 2026 09:07:45 +0000 Received: from mail-pj2-x00.google.com ([2607:f8b0:4864:39::]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWrvi-0000000FM1C-0e0l for linux-arm-kernel@lists.infradead.org; Fri, 27 Nov 2026 09:07:43 +0000 Received: by mail-pj2-x00.google.com with SMTP id d9443c01a7336-2f03335ec43so29337875ad.0 for ; Fri, 27 Nov 2026 01:07:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795770461; x=1796375261; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=Y/UMHkeyUCY25NbdTw5rz9oJMH9U+JYd8hruRProdo8=; b=Wix8FG5BFgZoGXuPlaZJZ14Vh2suHpndWcq9h/lCb+1AcP4t0bD8NnGSWEmqN9oxZP wdzrPcC+13xFOabwPUU3OlBWwNlKdSJ1pC7RIp6GKerXgQHkelmLy0w2TXZpo5RJKZQ5 jG+RvsvpxAOP12ht+rKCFVfEeHzTzLkOLmJYTvwnnPsQ/gBQIa6woFT+iMpiP6ZSr8pH d3m4IpYF8wmW59r9/hGgQppg+NaUJ1eUksFY3Mnwa5joY3yLWySvVg10JLb4nlbw8E2M I+EcS/Ef0UVNLSxqkIOBI4PnhZHBehm1Miizby0Fn8DM5Jg0H1FMcCFkctNy7EKUxOyy T1Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795770461; x=1796375261; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Y/UMHkeyUCY25NbdTw5rz9oJMH9U+JYd8hruRProdo8=; b=mHP+BmkVTJRi8+c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JE5T3xYweTxdX0cFPCaRuaDMlQ6q w/fHCatrW+L7qnCsS6g4xjfYOTzoL2F1YrpUBrkh082Z01AVdcCJD3V7UK+pGcXnOhveDmIwoo0 4v3rYmVDRi48yWhxF4PXoMLZMBmLpP4Vcs9nmk0Jqg== X-Received: by 2002:a17:90b:5287:b0:3b0:d35d:bb86 with SMTP id 98e67ed59e1d1-3b41c8fe261mr23255612a91.15.1795770460754; Fri, 27 Nov 2026 01:07:40 -0800 (PST) Received: from intel.company.local ([122.11.210.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cde6d06ee37sm11718725a12.28.2026.11.27.01.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2026 01:07:39 -0800 (PST) From: Wandun Chen To: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, robh@kernel.org, baoquan.he@linux.dev, rppt@kernel.org, m.szyprowski@samsung.com Cc: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, chenhuacai@kernel.org, kernel@xen0n.name, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, saravanak@kernel.org, akpm@linux-foundation.org, pasha.tatashin@soleen.com, pratyush@kernel.org, ruirui.yang@linux.dev, robin.murphy@arm.com, ruanjinjie@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org, iommu@lists.linux.dev Subject: [PATCH v10 0/8] kdump: reduce vmcore size and capture time Date: Fri, 27 Nov 2026 17:07:15 +0800 Message-ID: <20261127090723.741253-1-chenwandun1@gmail.com> X-Mailer: git-send-email 2.43.0 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261127_010742_200323_9FF565CF X-CRM114-Status: GOOD ( 15.53 ) X-Spam-Score: -1.8 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Wandun Chen On SoCs that carve out large firmware-owned reserved memory (GPU, camera ISP, ...), kdump currently dumps those carveouts as part of system RAM even though their contents are firmware state that is not useful for kernel crash analysis. ACPI systems already filter reserved memory out of the vmcore through their existing path: firmware reports those carveouts as unusable in the EFI memory map, they get MEMBLOCK_NOMAP set in memblock.memory (is_usable_memory(), efi-init.c), and the ELF header builder has always skipped nomap regions; only DT-based systems currently fail to filter these regions, which is what this series addresses. This series introduces a MEMBLOCK_NODUMP flag (suggested by Rob) in memblock to filter reserved memory on DT-based architectures. A new flag is needed because MEMBLOCK_NOMAP can only express regions without a linear mapping, while MEMBLOCK_NODUMP can filter regions that are linearly mapped. Reserved regions are marked MEMBLOCK_NODUMP by default so kdump omits them; reusable CMA regions are different because their pages are handed back to the buddy allocator and may carry crash-relevant data. Since the reserved memory regions are filtered out, the vmcore is smaller in size and faster to produce. The series is based on linux-next and is organized as follows: Patches 1-3: Preparation and bugfixes: switch riscv crash_mem to memblock, fold the duplicated per-arch memblock walks into the weak defaults, and serialize crash header preparation against memory hotplug. Patches 4-7: NODUMP infrastructure: switch crash_core to for_each_mem_region(), introduce the MEMBLOCK_NODUMP flag, add a dumpable flag to struct reserved_mem, and mark /reserved-memory entries with MEMBLOCK_NODUMP. Patch 8: Skip MEMBLOCK_NODUMP regions when building the vmcore ELF header. v9 --> v10: 1. Rebased on the latest linux-next, which includes the reserved-memory rework. 2. Patch 7: fix two issues found by Sashiko [1], by skipping the NODUMP marking entirely when early reservation fail and clamping the marked range to page boundaries. The changes only tighten the conditions for marking NODUMP and the overall logic is unchanged, so the Acked-by and Reviewed-by tags are kept -- Marek, Rob, please let me know if you disagree and I will drop them. 3. The remaining x86-specific race in patch 3 found by Sashiko [2] (Xen balloon inserting a System RAM resource outside device_hotplug_lock) is pre-existing, and fixing it depends on resolving other pre-existing issues first, so it will be sent separately. [1] https://sashiko.dev/#/message/sashiko-outbox-181183@kernel.org [2] https://sashiko.dev/#/message/sashiko-outbox-181179@kernel.org An Ack for patch 1 from the riscv maintainers is still pending: I have pinged them, but no response yet. The Ack will be added once received. v8 --> v9: 1. Patch 7: Avoid a potential boot panic on SH when NODUMP marking requires memblock resizing before it is allowed. SH supports neither CONFIG_KEXEC_FILE nor CONFIG_CRASH_HOTPLUG, so skip marking when both are disabled. v7: https://lore.kernel.org/lkml/20260922084256.1515554-1-chenwandun1@gmail.com/ v6: https://lore.kernel.org/lkml/20260902073116.802752-1-chenwandun1@gmail.com/ v5: https://lore.kernel.org/lkml/20260806093519.2907771-1-chenwandun1@gmail.com/ v4: https://lore.kernel.org/lkml/20260630074715.4126796-1-chenwandun1@gmail.com/ Wandun Chen (8): riscv: build crash_mem ranges from memblock instead of resource tree crash_core: fold duplicated memblock arch hooks into the weak default crash_core: serialize crash header preparation against hotplug crash_core: replace for_each_mem_range() with for_each_mem_region() memblock: introduce MEMBLOCK_NODUMP flag of: reserved_mem: add dumpable flag to opt-in vmcore of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header arch/arm64/kernel/machine_kexec_file.c | 29 ------------ arch/loongarch/kernel/machine_kexec_file.c | 27 ----------- arch/riscv/Kconfig | 2 +- arch/riscv/kernel/crash.c | 2 +- arch/riscv/kernel/machine_kexec_file.c | 33 -------------- arch/x86/kernel/crash.c | 2 +- drivers/of/fdt.c | 2 + drivers/of/of_private.h | 1 + drivers/of/of_reserved_mem.c | 30 ++++++++++++ include/linux/crash_core.h | 2 + include/linux/memblock.h | 9 ++++ include/linux/of_reserved_mem.h | 1 + kernel/crash_core.c | 53 +++++++++++++++++++++- kernel/dma/contiguous.c | 1 + mm/memblock.c | 16 +++++++ 15 files changed, 116 insertions(+), 94 deletions(-) -- 2.43.0