From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E92B73A4F2D for ; Thu, 26 Feb 2026 22:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772146160; cv=none; b=eT8XQ1TYcmyB8mH8Rq/T3KWSNs2T0k82NM90fQTcX6Pmj0KsgV5LmU2YdZ+wRJcSfTGf1MeIPUeu/Oc2Vwuk1jJ6DTwUXYN02TV5MsnJaMH8ACh/ZEC5LhMuatwtsXLaP2/f0EENtXId34t2BUX5eMTJJP8ZQbQiF78m461weJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772146160; c=relaxed/simple; bh=9XJprUJHH+fYbJ7JRjThngQYjlckG3iYgJf41aqrPaU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KLAYffIjxfmDQ6Oj2kcWwrSrHfboWWcmkhTEjKwWGw06qxkTftrb0jUlsvYbhOaMyO+PvVifYzKVDKjTmXlfH2qOfTYH+7+afYCjFp+aAbezcVANnBRzKyIlLtz5/geJBG1rP7F2ePo2Lcy/G6+ESPypNzaxyrtu8KhpE89mIbw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=D2J2ejrd; arc=none smtp.client-ip=209.85.160.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="D2J2ejrd" Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-506251815a3so12073721cf.0 for ; Thu, 26 Feb 2026 14:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1772146158; x=1772750958; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=oYDaj+HYxxwd2SoII0inXN8E5ab2WhHpXFva2vqM1nA=; b=D2J2ejrdhnArACxLg9uAeQ9+NW5S58YpyCDQaZzSokmaJcfCXRGYy436PIK29mgmtu cx4dA240xqdH99Lqtyty1l/UHS+QiMTCJ5lBHUFmehAIddTtEAESjsz1AA1FovL8m8Ha Yp0QUrFqZp/kzwVMJ3ihV5z37VwNSmpv83VYfN8XfU+OzVz7dUk+xTkEFkLxmQcOogMB +8pQ4g6zOtVqZUnsIXZ+DvndxzGO3sSgEe2z/JUQ4GLOESFfCF5YFAHKNzpcK6wbEWx0 QXILWTf/u2qZQirY+fTysy5oe3z7emyye3x8fU5gSeNEvCBGImKazCPHekFy/ga5/uRE 8rNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772146158; x=1772750958; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oYDaj+HYxxwd2SoII0inXN8E5ab2WhHpXFva2vqM1nA=; b=n1OGhdxtSkmGREOY08BuviLHVPZ3dw68Qg4QPi/QBxqZAGZCbaK5EQrSTbPGEevyxS n3gUSJBEtT7H7KXrE1Z1QXHf+OY2fR2g8LIDPhf5cFwb7wPEbLICnhH45Rk0GP7d0P+M tW/t1IyOxGKIqvyq466tqO6xCJ5Og/qrpRts9RJYuBWkuxx2j3hIiiPOaxt8lMWriGYu GfkPrv6tFobntOWi1FK5Wm3XqZz7N1kweiN1s2RWSJt8thHsIuQcqRqCD0BFdXbfBFuS dfy9lZQPEfcwaJe9ZMT87IrneQV4uyrnrJlqArerION944oVMSeaSsnQodmLnSztm0vf tzOg== X-Forwarded-Encrypted: i=1; AJvYcCWoBxjlieGZDZoozluqKKWGwa/ppuShmXKtk+HXhIhnlKMaWiwsGhpQfY6lZtO7vo18WfI0CBNkijs=@vger.kernel.org X-Gm-Message-State: AOJu0Yw0t56E0ywTA0GUchSCdcCxHyvHwFGhY2Et1kHBrTIruNjUqEep g572RV8wgnvivjYZr5tSuU21aOkBwdW1+I04AGyyXl41PE4ijhDVEGfiajZAiXAu7B8= X-Gm-Gg: ATEYQzyLv39/7EN1efg7PVeoOeS5XbJWuf3Xn7zIbLeGpJJtnus4g+UIxkmIWvymQb+ RwW24MBbfR317Hs0klqD2AbHD6B6aTedLrsUvpoO0X4MRunw7cKYzTwAQeCfnvkZvejnDLAPOFv bFZMW1SBeiomvPv0BBwcRXqTuPxloGU61zXLp2iCZUdCRgAirhoiMcuBVnw24OSMDXf89bNKO8I tFeLzJAkjrfi3N8wQWfG+vbSOSxysl1vr9KGIf23ev7CrqEgQAIc2TTTGmd/OiV6t2w+CUQpquS +ehyZnzy12MVjnIxB6Q0wcXeLL9cK7NG56LtourAsY8VkXvBdUdgjwvXaI/kEU2689mFRcINpGp WEfui+om594Bcn9puXuTFEcYN8PwYdOyGGERbPEQ+sDiwcGPh/pDCRSgEEHPlv7caDrfV5J2EX2 AKd0EJdx1u+8XJuHaOl7hxWd67OFRRWCF0KqEMH0tWZ1b6SlWmBJaIHuxq5Pbo2b/ZyWXxygJxH SH7gIlMiQ== X-Received: by 2002:a05:622a:1984:b0:502:a100:4054 with SMTP id d75a77b69052e-507528c1f89mr8534231cf.23.1772146157581; Thu, 26 Feb 2026 14:49:17 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-899c7159b72sm29449326d6.7.2026.02.26.14.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 14:49:17 -0800 (PST) Date: Thu, 26 Feb 2026 17:49:14 -0500 From: Gregory Price To: Alistair Popple Cc: lsf-pc@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, damon@lists.linux.dev, kernel-team@meta.com, gregkh@linuxfoundation.org, rafael@kernel.org, dakr@kernel.org, dave@stgolabs.net, jonathan.cameron@huawei.com, dave.jiang@intel.com, alison.schofield@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com, dan.j.williams@intel.com, longman@redhat.com, akpm@linux-foundation.org, david@kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, osalvador@suse.de, ziy@nvidia.com, matthew.brost@intel.com, joshua.hahnjy@gmail.com, rakie.kim@sk.com, byungchul@sk.com, ying.huang@linux.alibaba.com, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, yury.norov@gmail.com, linux@rasmusvillemoes.dk, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, jackmanb@google.com, sj@kernel.org, baolin.wang@linux.alibaba.com, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, muchun.song@linux.dev, xu.xin16@zte.com.cn, chengming.zhou@linux.dev, jannh@google.com, linmiaohe@huawei.com, nao.horiguchi@gmail.com, pfalcato@suse.de, rientjes@google.com, shakeel.butt@linux.dev, riel@surriel.com, harry.yoo@oracle.com, cl@gentwo.org, roman.gushchin@linux.dev, chrisl@kernel.org, kasong@tencent.com, shikemeng@huaweicloud.com, nphamcs@gmail.com, bhe@redhat.com, zhengqi.arch@bytedance.com, terry.bowman@amd.com Subject: Re: [LSF/MM/BPF TOPIC][RFC PATCH v4 00/27] Private Memory Nodes (w/ Compressed RAM) Message-ID: References: <20260222084842.1824063-1-gourry@gourry.net> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Feb 26, 2026 at 12:54:08AM -0500, Gregory Price wrote: > On Thu, Feb 26, 2026 at 02:27:24PM +1100, Alistair Popple wrote: > > > > If NUMA is the interface we want, then NODE_DATA is the right direction > > > regardless of struct page's future or what zone it lives in. > > > > > > There's no reason to keep per-page pgmap w/ device-to-node mappings. > > > > In reality I suspect that's already the case today. I'm not sure we need > > per-page pgmap. > > > > Probably, and maybe there's a good argument for stealing 80-90% of the > common surface here, shunting ZONE_DEVICE to use this instead of pgmap > before we go all the way to private nodes. > Out of curiosity i went digging through existing users, and it seems like the average driver has 1-8 discrete pgmaps, with Nouveau being an outliar that does ad-hoc registering in 256MB chunks, with the relevant annoyance being the percpu_ref it uses to track lifetime of the pgmap, and the fact that they can be non-contiguous. tl;dr here: a 1-to-1 mapping of node-to-pgmap isn't realistic for most existing ZONE_DEVICE users, meaning a 1-op lookup (page->pgmap) turns into a multi-op pointer chase on and range comparison. Not sure that turns out well for anyone (only on ZONE_DEVICE / managed node users, all traditional nodes still have a simple pgdat or page->flag lookup to check membership). There's an argument for trying to do this just for the sake of getting pgmap out of struct page/folio, but this only deals with the problem on NUMA systems. For non-numa systems the pgmap still probably ends up in folio_ext (assuming we get there), but even that might not be sufficient get LRU back. Might need Willy's opinion here. ~Gregory