From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (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 E2C64405C5B for ; Mon, 15 Jun 2026 15:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781537834; cv=none; b=bTg7vyZuD43x1HE/rbygJQFzBdMUt3jrxW8psSkCD5tacPAmiJ+dgHo80tfC2D/PzNtziwazciqIinADM8W/5MkPtTCIcgjmnG9FutFsB4MJie2KptoOgtmYtY55Sem4QkaZh749oYk9WdLFrLGj7cfMoMXeqlroBTicjPkqwIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781537834; c=relaxed/simple; bh=gDF7opo+wStJ7Wpr6WBsmAfccg6GFU4nXrKDloElyKI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CKOUqNdXgEubd+xm5YBk3XQEeUB9OneAmzeDXeyvwWgm5CnWerMoSuuBiWrKVUZi2/+fDXo/fRDwuv1P6KnhkIUd4L8pN3oNHrQjp/dnG3tvmkeKehzvwITRa/Bz/R5hJ7vqyMhDIPZtQnEbG2ZlrkFuf5z35wi5grR6ARa5nBA= 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=KLEg76Qg; arc=none smtp.client-ip=209.85.160.179 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="KLEg76Qg" Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-517863a2edfso27912551cf.1 for ; Mon, 15 Jun 2026 08:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1781537832; x=1782142632; 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=FjNePvEWoA1YkOvHP4nURdQdbVRIT8G3obtM70Agu6M=; b=KLEg76QgKm1XsT/3ikRHUJTUomNPspeQoumebDnLyIHMKTdcmfdCwF4rec2qZ1/7TO WpLECXfeef0DV2W5J6wjxSdcbTaOsbcYwHWAVHXeqHCz/6+r7zlNw4NdM4p5F8JplLfw wWtt5j+M2zW+MEe+v4khMNW55ALBwLbjH25qBCUBlXnuFjIaxjAmGAjP5fe3zTF5LGAx z6jkokThv8uVC93rAOimmY7cUaCUyWDKfgosdAnwWA2BRzMFQbJO3siBRlVhIb7nA7S4 1JpP6sMPN2GKB18x1K2Wj9bZZYARHZcNQtD95OUVHIVv+Rlxhi/89KwrrybRdnMVnDkV zzRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781537832; x=1782142632; 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=FjNePvEWoA1YkOvHP4nURdQdbVRIT8G3obtM70Agu6M=; b=bJ8PIxlduK91CCJEBhNE1sVEyYRkbAJHMoyliPyrbdsVREdtRjTOW6KWHM8x8zeuK0 HXtHI9soFhPZ3xT+Dfch2CuGnAX2TZ2/m6Rylu9LlTGMmwi1iJ2qesLawb2aro32czvn oUHmVWdVLFViMj/sSclVwGqvFE/fLzd8KtRX8IRMm1aabzAGbSkz3AZjnnR2JV8zgxnm +qfc1ODWdXiYhL6xtiizHuAKmWwr3gu6ZZ4nSZTSLtu5cvJFTXZJQJgkhV+QEc2IAEeG Ak17EtHtMj96wi20KSf0HrGuYx+/o8q4U7RXkNa00uGp38pktFn5IUNVfOkQNeLiB9Ws E+Ag== X-Forwarded-Encrypted: i=1; AFNElJ9HymwtNGXcqFM13lw5pcFoAUzHY0xl5LNYodTxgM/M7Xy+qMH8S4TH1+lphbmv731s25lBT48VWLvb4J2q3XAin8M=@vger.kernel.org X-Gm-Message-State: AOJu0YyW/0ieV9Eojh5w3jKRV0RrbjenVXxl13D4c8+1DS9YKDrVoWNg UqdgYcZfv8p2NyKzAyYp34Y05b9dFSROB9v5nQf1Jkgl6ilpTbBPmRGfchkZj8a7i+g= X-Gm-Gg: Acq92OGItqzxYeKVRHRTmjBLzajAIO6mLyLesYXDWoAQPn7yngfk9ilMaskiK0QPl9u GS69ajDzDN4iphVyzjr3Ib6YaNix9lQSr58yeaI/L7b7XtrKq/OEiiSghbIfhj2BgDBh2NbKcEP kG0cc9LK+jGbz1o/8sOy/qr4kPW0+/OLyhIjpNsUqmxV7oqgn7Fw+jS52SPc7gLeILdcDIv4tJ7 RE3guUWQqPzv+p2gTckBleW+jBFC5LIY0FVtueFBm6bpL36g85pHjnTXts740iqaz/gLs5SCc3N m4yR1lxAr3wvADTBp2VIelteTh6Tx/wWUN3ldKO57m0/uwp2Yq8dRxkSGxpJN7X+hGp/MR6aw3F BnMehAzsclDOx0+F2j9YG6o51apOLb7kz6L830Ca2nbeN4wmc2yjj9OyFVRByqf4ZCSycUlVXoI rBBYMQBKlckRgnG+Dbtw== X-Received: by 2002:a05:622a:1191:b0:517:5b2c:6aae with SMTP id d75a77b69052e-517fe1de684mr210273141cf.13.1781537831809; Mon, 15 Jun 2026 08:37:11 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F ([2620:10d:c091:500::5f73]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-517fb815976sm110238541cf.25.2026.06.15.08.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 08:37:11 -0700 (PDT) Date: Mon, 15 Jun 2026 11:37:07 -0400 From: Gregory Price To: "David Hildenbrand (Arm)" Cc: "Vlastimil Babka (SUSE)" , 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 Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC][RFC PATCH v4 00/27] Private Memory Nodes (w/ Compressed RAM) Message-ID: References: <9f1815b0-896b-44ab-9e6d-9316d8f11033@kernel.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@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 Mon, Jun 15, 2026 at 05:18:55PM +0200, David Hildenbrand (Arm) wrote: > On 6/15/26 16:38, Vlastimil Babka (SUSE) wrote: > > > > 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? > One thought would be a way to switch what fallback list is used, and then have specific fallback lists for certain contexts. Right now there is a single example of this: __GFP_THISNODE |= __GFP_THISNODE => NOFALLBACK &= ~__GFP_THISNODE => FALLBACK We could add an interface with the desired fallback list based as an argument, and let get_page_from_freelist to prefer that over the default global lists. Omit all special nodes from FALLBACK/NOFALLBACK and make the special contexts provide the fallback-base that should be used. On my current branch i think that would include modifying, in totality: alloc_folio_mpol() alloc_demotion_folio() alloc_migration_target() And i'm pretty sure that all just nests nicely. We might not even need memalloc... hmmm ~Gregory