From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DDFB4028C0; Mon, 15 Jun 2026 15:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781536755; cv=none; b=TPh2bSJgeR07j8yCd+w5jx8IvJJhZyEsxutXUQDcN80cednmxjWUed1lW+xOxkAPXiY4sSgVl56DZ8Dw+CTxYEGTMX3wi2kkctktRLOw7W8qOliKbYqaBDuqC1SLYN4TWF5pIdSYtEsIHJKbRJ5SwlAA08RY5WJ5zR/NnOhIWbQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781536755; c=relaxed/simple; bh=13ZqX7uS0cq42sxFzY3Pf+ZkqwS24ktsOvXdlTRg2oQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XBWwFUWyTBebr6TpGoqqzivZgl5ykbc6dx4HITL4dfWRn18fDJfuYeZ0tcr/PuKlUfb2IxLlRTAp5IvrYwXyt0EdbkDMpTMFB6m+sMHOZbuI2651njogmYzkUJ08YLQZaNmpI4xEdTQnJ8YHmSI3bDUtElT8OvwXPIeDaS15eSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bL5WQgTA; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bL5WQgTA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 661F01F000E9; Mon, 15 Jun 2026 15:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781536753; bh=BxSEOqlSBZuD8UG1OxckOzTAW9sEE81ofKrube+ljdM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=bL5WQgTAQIYQN94P2+9/RrdwzzunbL/knW+g3g+t3KKwWuBwre42yyGtxKXSAIgNU MX6CNuGiRmcOmGNOcJYzEfj22aVDPwMTBaiCrDz0LDIs7OxTC7xiZI6iS4kVFWZXFF OARDTafVkEETi9LYWK4Am6hfAwuctlTriX6/2MdjZOHU/h9pD2HvIUcLGqM5sNjGLJ Ew/KkhbuQNJYJsNyvp0JSMHjlfxGtN+eb5BMSC+tNFZSOkOsHOD0Va8/mLcbi2Mzsm 7KGrQ6QXrWspgVxdfhWcJ2FFR5kdlPliKfD49wi4bMgFl/oiZ2W67rUWNbM7FRCWxk kxdHodnuGB9OA== Message-ID: Date: Mon, 15 Jun 2026 17:18:55 +0200 Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC][RFC PATCH v4 00/27] Private Memory Nodes (w/ Compressed RAM) To: "Vlastimil Babka (SUSE)" , Gregory Price Cc: Balbir Singh , 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, 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, apopple@nvidia.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, Matthew Wilcox References: <9f1815b0-896b-44ab-9e6d-9316d8f11033@kernel.org> From: "David Hildenbrand (Arm)" Content-Language: en-US Autocrypt: addr=david@kernel.org; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5L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Zw7jxUCs4UUZLQTCuBpFgb15bBxYZ/BL9MbzxPxvfUQIPbnzQMcqtpUs21CMK2PdfCh5c4gS sDci6D5/ZIBw94UQWmGpM/O1ilGXde2ZzzGYl64glmccD8e87OnEgKnH3FbnJnT4iJchtSvx yJNi1+t0+qDti4m88+/9IuPqCKb6Stl+s2dnLtJNrjXBGJtsQG/sRpqsJz5x1/2nPJSRMsx9 5YfqbdrJSOFXDzZ8/r82HgQEtUvlSXNaXCa95ez0UkOG7+bDm2b3s0XahBQeLVCH0mw3RAQg r7xDAYKIrAwfHHmMTnBQDPJwVqxJjVNr7yBic4yfzVWGCGNE4DnOW0vcIeoyhy9vnIa3w1uZ 3iyY2Nsd7JxfKu1PRhCGwXzRw5TlfEsoRI7V9A8isUCoqE2Dzh3FvYHVeX4Us+bRL/oqareJ CIFqgYMyvHj7Q06kTKmauOe4Nf0l0qEkIuIzfoLJ3qr5UyXc2hLtWyT9Ir+lYlX9efqh7mOY qIws/H2t In-Reply-To: <9f1815b0-896b-44ab-9e6d-9316d8f11033@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/15/26 16:38, Vlastimil Babka (SUSE) wrote: > On 6/12/26 17:29, Gregory Price wrote: >> On Wed, Jun 10, 2026 at 04:12:52PM -0400, Gregory Price wrote: >>> ... snip ... >>> >>> I will still probably send the next RFC version tomorrow or friday, >>> as I want to get some eyes on the __GFP_PRIVATE-less pattern. >>> >>> Also, I made a new `anondax` driver which enables userland testing >>> of this functionality without any specialty hardware. >>> >> >> (apologies for the length of this email: this will all be covered in >> the coming cover letter, but I just wanted to share a bit of a preview) >> >> === >> >> Just another small update - I am planning to post the RFC today once i >> get some mild cleanup done. It will be based on the dax atomic hotplug >> >> https://lore.kernel.org/linux-mm/20260605211911.2160954-1-gourry@gourry.net/ >> >> But a couple specific details regarding the memalloc pieces that i've >> learned the past couple of days playing with it. >> >> 1) memalloc_folio is required to ensure non-folio allocations don't land >> on the private node, even if it happens within a memalloc_private >> context. Since memalloc_folio may be useful in contexts outside of >> private nodes, I kept this as a separate flag. >> >> If we think there will *never* be additional users of memalloc_folio, >> then we could fold _folio into _private to save the flag for now and >> add it back when we actually need it. >> >> 2) memalloc_private is needed to unlock private nodes, but in the >> original NOFALLBACK-only design, you also needed __GFP_THISNODE. >> >> This is *highly* restrictive. I found when playing with mbind that >> MPOL_BIND + __GFP_THISNODE generates a WARN (valid WARN, it normally >> implies a bug). >> >> That leads me to #3 > > I think the memalloc approach is dangerous due to unexpected nesting. There > might be nested page allocations in page allocation itself (due to some > debugging option). But also interrupts do not change what "current" points > to. Suddenly those could start requesting folios and/or private nodes and be > surprised, I'm afraid. Yeah, we'd need some way to distinguish the main allocation from these other (nested) allocations. > > The memalloc scopes only work well when they restrict the context wrt > reclaim, and allocations in IRQ have to be already restricted heavily > (atomic) so further memalloc restrictions don't do anything in practice. But > to make them change other aspects of the allocations like this won't work. I was assuming that memalloc_pin_save() would already violate that, but really it only restricts where movable allocations land, and that doesn't matter for other kernel allocations. Do you see any other way to make something like an allocation context work, and avoid introducing more GFP flags? -- Cheers, David