From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A510606A324 for ; Fri, 27 Nov 2026 09:07:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=zNsFX84J Received: by kanga.kvack.org (Postfix) id 887536B05C4; Fri, 27 Nov 2026 04:07:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 85F286B05C6; Fri, 27 Nov 2026 04:07:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74D8B6B05C7; Fri, 27 Nov 2026 04:07:45 -0500 (EST) 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 0AFCE6B05C4 for ; Fri, 27 Nov 2026 04:07:45 -0500 (EST) Received: from smtpin14.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D5B5F80290 for ; Fri, 27 Nov 2026 09:07:43 +0000 (UTC) X-FDA: 85480321206.14.5B0CDFF Received: from mail-pj2-f10.google.com (mail-pj2-f10.google.com [74.125.227.138]) by imf11.hostedemail.com (Postfix) with ESMTP id 1D27D4000C for ; Fri, 27 Nov 2026 09:07:41 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20260707 header.b=zNsFX84J; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of chenwandun1@gmail.com designates 74.125.227.138 as permitted sender) smtp.mailfrom=chenwandun1@gmail.com ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1795770462; b=gKWaQtYy/99gbLF63QkLLmjlOT83tbr8LuutqKxNPUX7XTayZW01WTVoTPHJyAJsUu5Q53 UuJug881VwUJnin3jKUu4/VPedxC+CiukPDBZOrlTwQYEWoGpaFehMRQpr5Shu/yNW5JLU 8cgcnRv2C0geWiKTzriouI007k5WtFA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1795770462; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=Y/UMHkeyUCY25NbdTw5rz9oJMH9U+JYd8hruRProdo8=; b=VKj7g8I8bRauM6QJ097DH62balHVUKhLrowXejK+qj0E+Z21+9VoTJHc9lKH6Gvk/pTdLR gMcVHnU1d1cSAoIVBLP+JAGyMssoE6lNfiRe0kmoo66t2/K0VJJdis2U29zhhHjodEMutK SB3543jGGOotmrQMdVmNwQVSAqIstzA= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20260707 header.b=zNsFX84J; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of chenwandun1@gmail.com designates 74.125.227.138 as permitted sender) smtp.mailfrom=chenwandun1@gmail.com Received: by mail-pj2-f10.google.com with SMTP id 98e67ed59e1d1-3b3d125637aso1562251a91.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=kvack.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=zNsFX84JmijAlU+w4ctXuW7RA1/F0Pom+VB0TNkQMuYVI4VuLNacy72B9+HabRJyC4 wRg3fQLygBri+aXM7meBm+JlbUOaYVd/DGOjlhEGmLhr+ykdNtaWfauyiJllQSnTjZQw B02oQKXlEVSWlfRmnpazk2j9RipV/whsYscsYwotLNaRUMewa8Th6vnhipjojiOjwKkr fItXSr2xNU0MqK2i96GHYZOCeVfRNihP32LPkdWAwhYom1lj19oBm/gSww8dhu0o7D4C si4E3jLGFaco9986aa5jQYiZCWvcRvMkp5oULkAyhxpl/nd7kc5anVp6TzhvWRz9wuKT kZaQ== 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=PjG8JvBme2fWMCCLyjhKrvga+q5NTvBVJ/DVQ8ovURZ7kjUdK6/jZL3O51qDwHzeXz IPRxjYdR+zhFrHsLeVMn2pb5NCsfIg7Sdk2PxBHFTa3GxKx/cZZNM/0DG6kq1wNG2i5V km3ap15Or5MDj9pUlFHNDQBc6vgFHIcgaomxfptcgzZv7xBoXn+Jq+R4OmdRExpnSpeA 5tPfkx5doyVN317fuby+XIxYoLkQ7pOtS5zIEDZdzLRKPR+N0xJz+0hewuoaMyccNrRl +FwTB6SktxgT8tWa3pewoHt0Hy3yikCoYPkgxQjLtWJvxTijSd3YRugrAyEN2jdeEv1V b/JA== X-Forwarded-Encrypted: i=1; AL+hErH8u3uS2qeBec1CR9haplTRvZM38VZvrUgY70OGcDffJ82bN8q+Kv2VJUK/4A4+Dr7uyr/uudoknw==@kvack.org X-Gm-Message-State: APuU4Z/dcHNnb2Jee7vaWCVpDqMvSBHD7QZmwUgAoaHfxtdYoatD6chW 0fMWpINFX3K7gZHf/yVDnS5zNtL+DJ/NBgHaSU284JiQCvTowtdRtuD+ X-Gm-Gg: AZFdTZeS7+7KegOKL1uGR5TM36mFJjYmCAHgFiMHOAatl/JW1tMp1j3VKbvK3ynyv8d VuIS1HtGMhYQxrA3pjba9mhrJT6G5a+3xmUYqxbgOwzwou0DGhMRxHL0AkBTGoki390X4azuFs0 XYs9osSIQqJ6RnBS3aM035vsO4pDSO+XRIrr1OQe6WVzB6rAIHRklge2qBE3emmoiNfVG2g6aBg kXQOuI9MaA2oyAxD43JdfzjXPwHstir9yLX2tFj+Lbw5dK4bKMq5r123J/kIrq/0yPEIdRcxa7J j139yRD02RffobXaLjT8GrnjaoLk2hgG84CfcTrJbV/KPVzCIYq0+ENEbT1sj6bvNentedSQ+1e 9uPU/DUmcRNeJko9M06bh/t/vpNsRzdIhVBlWOdt7IiGabrK3XZDzNwz+29Ze6E4/Xs8Ag6aszF 7FJzmwrMZYmEN8mmU5LdqkTGK6nluyFSiz0GLftlS/t52xDvyzJFF1B3glF4iqGpyPBhOBAkcmO slgPZtFRsZPr4BdKxTWKrrx/a62d3oATQFByJW+SPHP5yJJZZtYxdTnu2rjjyqWEkl1NfRoBiK8 sfKBLrGsy7cAlxQpDTPXfxhTwqVH1v4DPtMlRjgEPw== 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-Rspam-User: X-Stat-Signature: y97htxb4zwhwpmzg3hx7z5x8riyhesux X-Rspamd-Queue-Id: 1D27D4000C X-Rspamd-Server: rspam10 X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-HE-Tag: 1795770461-508868 X-HE-Meta: U2FsdGVkX1/39K2Ke5jCWLdKnuJU2UuL1I0X8/gcsVgsPdNfYOPKtQzQJQw4FOpX2ekNDvmysROd9LrLSDouc/zsstHx6UClhhE+YSE8+8WRU/hheChK+wqjPhgSFX25bKehMZPkd9pzS4XLujfElA/Fva8DXoLC8hf14PRcSqbARazW3jtkSubW1mNvYIwqadWsHFpPdzS+CkYxqU3k+GPfnbo83eruYlTDZw7TVB+EkuHv1eEngyVE144F5s9nXFyLRoDDzD03maYyq5IqX7LVcFl80puwAW6FJxZ4AdMwuyPKPxTxYTgLALblWxoLki4eMYtYOovQBlwUvFZ/RvGFd57faNQiEBzXyqDJwKMWT0xUVgvR2uQZniRn0dWJrGdPLuxlq49j69DiIZErko89ydb/WGuTagR6dzHS6gDz6xSb2ZuhNFoYTM/21t5gcna8vLxe/tHuTz8UJPnP1Ngf5gc3En45xjGejwu1GvNHOSOdggJlGELW2QyxF+qjF7FYFCHOHWtPo6kdZxLvDmAJxxTwRAxuJKTkqfxsk3EVQE7120yJjfHBbsA9qtJ3SNfFZqPWi4Kde4okMJhAUsFpJZmXL6JTXGilMa1vFWS0JzxxTFz0iiQsmi8ir4zxNzQOVcy2czzqIh1s/zV/UJgCAc4vpzeBcmMr60/KFu+wTJNLKmXvt39rKtV8NRng1zUQTHsFX2sbiWVIiy06OK7crmqpGZ1r8rKNSz9T8bsMXp+BtA2O30hI7mxbe3lWxcrOF5FIZ2M5GeeaikY1h8kZVKJn45Ctcz4kQMDoBt3zUCvxGJWJH0vWNVRA9UHBC8Y7w2/QIavPPzZAq29XXyqymi1jReDLX9FFVf3wvZcE+9r3F4J/qDVPJmk7+Nq/pSFwAWHb71Kfg44muNjAzEaeMhtMbYwRaLUT6TNwPjzN4Zc1q4FUoW6egGsp67Bg7WHtnEf2n2Da13zcLV5 m/ugv2rA 2MNkqWzLfmeF6daVKi0K9q8ZqehCxFBmrZLAzSqKiYpGRvsPUvggtjFLQuF+ZDOaToZBRhEqgQH2FyUGt9ggM+LquD4d+5306+fpuDTzfyJqMsRQcokZhr7+qC3d2doch4V1H/G6eSNvOo7fP2S9CalLEOrIoqhcETGdzzefZfOoZmavK2AkJpXaE9VENFsFJ69t7N5I/7l0TRCXtwD0HRj4Ax3XlXijAx1YWDi+pAPom3j7bk+5/CWFuiYhHzol2zct86AGRzy5zkqzjR2i2/hsIX0blcEvEIDRlXKrl+pRpy/mSlvGeK1DXF2gZl2MM7YPY7dLEQwzKhxul/mptxMtWlG9UcfVwWrWMu3+IW6ASC3ob9Gd6VQItYCJ6a6bK3RfxdKvxm+MR6P2r+rpWakG2gJVUbG3OlmkdMAd4J75fDNUzfPV4rQB05k3R1cPj0l+XhlU4iYSd8lwnkUTIDd6ylgxtuR7TmYp/zLH03H+gC9k+poDrwx1KivCVAYtCPmsBVvyMSbJBLImIXOken8fC+/l78f9RoeOoopiFE5Sb5gItb9ORQ4/6u2rJBTtEpVj0mWIyvu1EeykSn4s/5S8YynyozJQJ+UuzrHZrqdXFBE/ZsldGoQM7yJYbgbmRvfWNHZiR0NKT1ptQH3+F/sVrcu8Ki7T1a+yObOtwuOeLyQ7QvPixkwocpiySO1V/K0TmfzJ6mFqcQPC0FTwUcNGIoxn6VxyLcHD1z5mplQaWY2A= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: 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 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 7CE5C606A31E for ; Fri, 27 Nov 2026 09:07:50 +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=UV/5Uc4z; dkim=fail reason="signature verification failed" (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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To: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=No4WbVIBLgjc0im47zyBKJ77uNJU/uoreiXaYAsrCS4=; b=UV/5Uc4zGuqhe+2PswtCEt+X3M WPluIZNGX8A/0BdjZIHMij6q+o5qs/rUriFoF+E84TdfPaYOQNX46uhCQD4Bu5xPmEyw6WMXiOWoh ibxyymnio6pwa1b50WvcTX9VvirQsak/u72jU9oHk1dmJsqfRjCeIm3K/IismPJqyJaKr4S0x3pmE Kq5Da/iyAno83ujGVbTXFB3Fz4rGgWrQZZlEIM4zcF91xUL4tb1G+R89PlBKcsV2l+w1JQS6ZHnDo S19zcqFDX24LORqUUCxayCkRP7/9NlKmIaT0LjfnLU5vEkuyN/9Z9hSio5NASohkjMGwt1ITNRiiW G4hln5ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWrvl-0000000FM3Q-1BFz; Fri, 27 Nov 2026 09:07:45 +0000 Received: from mail-pj2-x01.google.com ([2607:f8b0:4864:39::1]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWrvi-0000000FM1D-0jRN for linux-riscv@lists.infradead.org; Fri, 27 Nov 2026 09:07:44 +0000 Received: by mail-pj2-x01.google.com with SMTP id d9443c01a7336-2f04824c47bso16884625ad.1 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=B85toISpeLaqCiy5WdXUYtZsacIMyTEFAKwohqcZvDAGlQyMP1T0zA01l3Y2R0jwXk feREvnw0Uk1yLec8grkVAQyGv4o+0kC3DSQsAPrSBx70+5A2swhAW1aryb6NPdywT2XE brN+XNpNujdhFfZ+bCJLyVjxjLf3rqRdLNjbL+vZhXxIzB5VI0KGWpQIi6U8U4EVXt7E r8fwoQW+pSfBbOo8vY9F9ztWJP0CmlTYOSVAKljs28pBjrCSRAMgg8PqrFE0v386WaFC aH6uVIOPOJN/vQWQaSwtkntalcmPRaNF4WiUQMOt3xadlWTG/vhAPEQMLkZxfjrq6KlE 3gxw== X-Forwarded-Encrypted: i=1; AL+hErEYGythz9ouqic0fBxUS9DH3fXNNZdAa+N10xz2Sx3axwLJZFiNEvMCVsBf8NKPqlQxK/o8m8O4+i+FAQ==@lists.infradead.org X-Gm-Message-State: APuU4Z+I+sL5K11j4KNtvORpjqnWr10bUsGb+rEghcHPQT+0rwuGOGXb IFS+hs1SfWDF5P5BcYJnnobblxQkbx6eJrW3Jzhr5/BvppDTRrYCG3ig X-Gm-Gg: AZFdTZeiFzsFJdX3krJ4bAwbEysd9DTDbgnIksHO7vUG28LJDuFY0wtanmvVrAtm9wu 9oOllfxPmGsPywW9eTyU84KUyfxjoFrm1X+IKrK3M4+pj8iUV8RONL/yF017BzAfWS3A8TjY8td xY1ZJZG/+6nIxk9M42qa0D7GAZwNShhf/IdbAtczOm34FRp2qQg1hASxP9YcNn6pTrnkdoYcu3R 6Y3oxpeDdjjNxwCKiRN3NgmgMSiZHY3+C3IFiWAC4PnDbr1QPcp980XTkBjcaqdGpmyUugFZTp+ JoGfPetGldtqyuhG0W/1iRXqcitCdHoEGHvqXsqIJ9f6Sd+0pw+PlDyPAtWwztsuGcS+FE4S1z/ pSWcHEHVHdgXg7hbgf8zcIPEzNwfszOs//rUNGG8D4UB0F0ug5MeGbTyw29zQhYWqzuJnDvbch/ OwlvWlfXaZfGxzVF7v7u0NRabghjouzBIOk4rG/Y/15KKrmznC902AUs7noPMiedduQKXLXgqbg uiqX8YnfMkP6bkuiW1a1PS7TdRGi8h/igV13VqZYgsgOHCdKWX6WfZBU49vxnDh49TheaH9HnYA 1CkOM3WLkWVJI8sVEnZAto8U5o5BCFdrDPQ0cojMZA== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261127_010742_214764_F2656C7C X-CRM114-Status: GOOD ( 14.01 ) X-Spam-Score: -1.8 (-) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,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=ham 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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv