From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.71 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796317341; b=QOUou5TxOf+y1MHU3eIBaxPY6hi0MpH1DL+HpvbGQJcdu8TaMh+8quBQauMs7Dt5seoS 3n1LQu30Jvm1hM8wPIAi06iWlzHaVA0S7UrZASlQt2q+M+dgeuxHCpOXZ1unUDanWlj6W Pu+Nv/9/Qz20MQUgeixQYWH9wJ7jhk2doMfeLKh2f2EyKVAA9bdf0eUB8hWze5GpgLoCm JbnMjKHFBSnWmuPPMIu7jtrZ7drV2Xcy59ST/5ZLs9s3JASMjBTXZl1CJUFKj+mudQt3m jSYTzunhjHG/iyNdT0EO1ohXN9P+esEMCrX+6wq33WVeqK1dIRTQVAKYqRxcs6ryv8Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796317341; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=D087ZCYjlYVMs+4aSwyHru0jvEINoAAdrZKjRL9oSMk=; b=PNtsnNtl1b8RLvlpl2AMwzB8SaKKlfddBly+U6dMDKW5ab+IhSuy5r/k8G/VZ89TnEjD mft/iYi4Ymrf3CWPzNxSSiHtDx5puWo2b5bFuE15LR7559RT7hfrwLonuFRHPHkegqwUH UBXk1ZWU51d8X7nWK8Mfy/br7RlDU5VWnlEZFz7OkHBCxYAduYQSC0v0nrmZuYBEyNWmx +Eqo2FE+2ptCYLrXebdthaSaM9cHrYN6b/ieIZd1/YR1pr67uqNVrZY8/QAdlVpX51Y85 tpJ6coOeu66MmIJVuSLGcv+y6tRzDTdAY+ujxF/4kk+wXaTHrUeG0GQtWlPEDmbdiVA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--suseendranb.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=GdFb4Mbw; arc=none smtp.remote-ip=209.85.160.71 Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD05A606A32F for ; Thu, 3 Dec 2026 17:02:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BD05A606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--suseendranb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=GdFb4Mbw Received: by mail-oa1-f71.google.com with SMTP id 586e51a60fabf-4b6c84feb67so36371fac.2 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=1796317340; x=1796922140; darn=vger.kernel.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=GdFb4MbwjcUQFNs9/QAS5GILHmBZMWsdKIyLn24vGCuIO+a9W+9yD+rKOQINpv3R5j tR+VT6WKnJ6sR/eGBT8VnTqVcqhnsWaxM3Rdn3aBy+I++BHf8xNW7q2FrWuNQbWgrL+Y dcViAJK7JsRiZE0Ofp6y3r3I1iclyMxouwz75EpRu/L0mvO5LGzUwXK43GR6dCXAaeum 54uadt8TVxHKI5aDrlOigpM3IWg2ayoqegeuuAnE3UAHS+98uQIwdXlpRptDsaZ3H63R neT3071+Nbr1aLdBhqKqpolEJKIs/p/SHY6VUbHM5lKDIpsFimm+je4tlfUjQR7xdDCc DPFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796317340; x=1796922140; 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=whLECjD6AfdD2DqQFo7X0oz/QVZ0MLP89jMeoHvuLNcne+cUg/XPa+0r0biTabglM9 2UW17jM39QjE/p7LrjYn4LQFwB3nVKFkxcLWPZ7yZpkxsqkyvp7yfPlgZEU+E/HFpEpx fl/cs95Ekjkd7z86W2lhDC1/JFt79og0SW2uC0mcP4vMwTBWxz7Y/DbVCZTPyEIjlH5R VyUUJdnUjFBcm/GBbDTJUBenXEuejQxXClXKU67XoCI/IJ/ulOmoC0xZKoRREM+a1yZZ 5bRybTQ9oiHMvnUvu8S79jmi0DCJo+AI1JCizpcvvEpd8qv9cQVqKy2E7utu7CXHWiJQ 1tHg== X-Forwarded-Encrypted: i=1; AL+hErEsRzMqMIOtIuNpKgALwCeP6S7TQVlrcswvM7zEqpiniLgFUGUf0LrvF6MwS2yiG1WTFQE+rpxryUYVLYc=@vger.kernel.org X-Gm-Message-State: APuU4Z+VumtxoZO8Y8jZNNReZdJ6NYCDiaVYyDuBQ3sbJsOXd1wOk/Iq 0j7cxV6wYnvCJR4xRkEz7y320DEfkP6mknF6oNC1BCBz5pPKhg7MTs+hgbeDs6sXFHuihsR3Imz Yz4IB95UrbJ7397ZiWqdx3kQ/Mw== 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-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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" 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