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 2DCEF606A322 for ; Thu, 3 Dec 2026 17:02:38 +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=pf2hUHPj; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=lsy6Eayf 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-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=D087ZCYjlYVMs+4aSwyHru0jvEINoAAdrZKjRL9oSMk=; b=pf2hUHPj5Rxbo+mzYhGUVOdVP7 fB07J1yCiTiJ7yStwHB3ScD4LyeXs/RvE5E6tOm+5MRZ29IxiEbvssW11VA6ZayCpoBjc6Mzf8WAb mjpGwjwR3CQ2f0ya37Q1PIOkfA4QVsJLU4e7GRgcjRz0ofMqS0FkIqh84LfypLB26g8BRpbvVOt3t oahcx7OrkAL/LN8uLOSSU2JQ+dywAufZoET1EewkdjNfWddzdBI65fS0QMZKytzby4mBGPIohLo1W IttgrIuppw7tijccoZTVsjqbsYkeEEQh13fu2QljDPwHMbyiqYcVPEfL+Nts9UeoNuVv+1+WAtdjd n4F299bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZACO-0000000FMNr-1UuX; Thu, 03 Dec 2026 17:02:24 +0000 Received: from mail-oi1-x245.google.com ([2607:f8b0:4864:20::245]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZACL-0000000FMN4-3xkA for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2026 17:02:23 +0000 Received: by mail-oi1-x245.google.com with SMTP id 5614622812f47-4e778acdbc6so32985b6e.3 for ; Thu, 03 Dec 2026 09:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796317339; x=1796922139; darn=lists.infradead.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=D087ZCYjlYVMs+4aSwyHru0jvEINoAAdrZKjRL9oSMk=; b=lsy6EayfbnUeog6wCNudFJx3D26hGvliq24YZROspgcKbJWnTpHUh5RFAJRR0DsM3N 2nc1HtoyHxhlIgNhnDGEfQ4Hkkcxw/HSeHZkY4oZE2NbmFGOX05w3FmhBncInydldck5 5G6rdfHf7U1f48O2v3D4btkFiiIs9Q0XTHCMbqp94qzkcDaj81dX0G6FDzDgcyMFBmgb Z3gYs+1aXdrioEpyA882VPCN/7AVATFF8Kypv6mqyJwlZM7zyTsT/70BSr6viGUtvi9I O5EyyydDPjwxDOGR+Eo+ZCxHldi1C9FFo1Fas1H9QX+nX9hFJNPtNqffTPsG+gW46YMd gVBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796317339; x=1796922139; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=D087ZCYjlYVMs+4aSwyHru0jvEINoAAdrZKjRL9oSMk=; b=TJCmV/+hwUZEAj5phwt32ND62LuNCZe2no7K6bLJ8iBKhe6lYT+fWb34hZXCtD5ZGp WEp2MYYm6QNuaCaW5L85wqy6DXmo9JgKB78phdbuOqcBJGVVmnOGVXLkYhN9kc09yQnf n5q+3DsQPVX3JWzeQrDCNABT03ISPefcl+Vo9VvquZoU40SgehVtZ0LqubsTl2FaWbKC B+jr7iMM4mKUVO5qhsLTvv2l/2bhqlDeCySQo3OwGRjg327QXguyIHckuVRRjB2cvTHi 3sh7vLD5YKKEsy0CqQR6IPoz3ZUf1fkhwDZkUXgWJfjIcHq0gWZ7R9rrRR6mohdLgE/v v1ag== X-Forwarded-Encrypted: i=1; AL+hErH+9K1N3TAD2XpNzXkvEsAXZ0reciT/IOpCyjBHos9lD1lDd7wF/HOcKL/EAftKjszJ9fKJD+sJDtu8e5On0TXb@lists.infradead.org X-Gm-Message-State: APuU4Z8JVGw0WZVJqmOLxhaGMjLe9psxuTqtxWiu3am/Jm8cDXX/4QvP rRLrh6fDc39vr/eOkjEd6aXyVRSSNC5GduUUg0WzjUib7J1FYavnMzSEyfZkDLipuHGjWSOcc0v 8QbCSS03kXdoDyF2drTGVSrG3eQ== X-Received: from oobeu17.prod.google.com ([2002:a05:6820:3091:b0:716:84f6:89ba]) (user=suseendranb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6820:161f:b0:71b:8a74:fc20 with SMTP id 006d021491bc7-71b8a7501c1mr24340469eaf.39.1796317338834; Thu, 03 Dec 2026 09:02:18 -0800 (PST) Date: Thu, 3 Dec 2026 17:02:07 +0000 In-Reply-To: <13f4b407-7020-451f-89c9-61bfa59c763c@intel.com> X-Archived-By: Mime-Version: 1.0 References: <20261202001946.1226273-1-suseendranb@google.com> <13f4b407-7020-451f-89c9-61bfa59c763c@intel.com> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog Message-ID: <20261203170208.4170050-1-suseendranb@google.com> Subject: Re: [RFC PATCH 00/11] mm: NUMA-aware boot memory carving (extmem) From: Suseendran Bhaskaran To: Dave Hansen Cc: Andrew Morton , Mike Rapoport , Dan Williams , David Hildenbrand , Alexander Graf , Alison Schofield , Andy Lutomirski , Borislav Petkov , Catalin Marinas , Changyuan Lyu , Dave Hansen , Dave Jiang , David Rientjes , Frank van der Linden , "H. Peter Anvin" , Ingo Molnar , Ira Weiny , Jonathan Corbet , "Liam R. Howlett" , Mark Rutland , Michal Hocko , Oscar Salvador , Pasha Tatashin , Peter Zijlstra , Pratyush Yadav , Randy Dunlap , Shuah Khan , Thomas Gleixner , Vishal Verma , Vlastimil Babka , Will Deacon , kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-cxl@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, nvdimm@lists.linux.dev, x86@kernel.org Content-Type: text/plain; charset="UTF-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261203_090221_981631_86EF60BF X-CRM114-Status: GOOD ( 18.96 ) X-Spam-Score: -9.5 (---------) 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=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL 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 Hi Dave, Thank you for your feedback. Agree that the cover letter jumped to the solution too quickly. Here is the goal and reasoning behind it. On Wed, Dec 02, 2026 at 04:34:59PM -0800, Dave Hansen wrote: > I think this jumps to the solution space far too quickly. What is the > actual goal? What does the carve-out achieve? > > Do you just want to do your own memory allocation? Are you trying to > reduce 'struct page' overhead? The goal is to let DAX/libnvdimm consumers use normal DRAM without x86-only hardcoded memmap=nn!ss ranges (which break when memory layout changes) or per-host firmware setup (EFI_MEMORY_SP): e.g. /dev/daxX.Y for guest VMs persisting in place across live updates, or /dev/pmemX for fsdax where block-filesystem semantics are needed instead of tmpfs. Primary requirements (as in the other sub-thread): 1. Arch-agnostic across ACPI x86_64, ACPI arm64, and DT arm64 without per-host firmware changes. 2. NUMA-aware partitioning (keeping System RAM on every node) without hardcoding physical addresses or firmware holes. 3. Preserving the exact ranges across KHO kexec. For allocation, yes: consumers allocate out of /dev/daxX.Y (or fsdax) directly via existing DAX and libnvdimm drivers, not a new kernel allocator. Reducing 'struct page' overhead is a secondary benefit. Boot skips ~16 MiB/GiB (4 KiB pages); post-bind, the overhead depends on how the region is bound (e.g. raw pmem uses none and huge-page-aligned device_dax on x86_64 shares tail vmemmap pages). >> - Runtime memory offlining cannot guarantee 1 GiB physical contiguity >> after early allocations (and boot RAM cannot be offlined on arm64). > > Could you talk a bit more about this, please? You're talking about > limitations of the existing implementation, right? Why, for instance, is > enhancing runtime memory offlining to fix this not an option? Yes, some of the problems are current implementation constraints. Even if lifted, I feel a few gaps remain with runtime offlining: - Across KHO kexec, live ranges must be excluded early; post-boot offlining runs too late on unpreserved RAM. kho_preserve_pages() and reserve_mem= are already early-boot reservations and keep the range as reserved System RAM, blocking DAX bind. - On cold boot, 1 GiB PUD mappings in device_dax (x86_64) need 1 GiB-aligned chunks. One unmovable page would block offlining its whole memory block. - Offlining leaves the range as IORESOURCE_SYSTEM_RAM, so DAX requires hot-removing boot memory blocks and re-adding them as ZONE_DEVICE. In-kernel helpers exist (offline_and_remove_memory()), but it still initializes and tears down boot struct pages on every boot. If you'd like to suggest a better approach for the requirements, I'd be happy to look into it. Thanks, Suseendran