From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 3BF573AC0E7 for ; Thu, 16 Jul 2026 16:56:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784220970; cv=none; b=YwalCxy4zvZ8Vn8bI1gajuR/MV9tNj6Kmt3nk9wXfHHFKF9Ofu+2wYtLwAaBWJ7v/pwQ9FJDCtqG8WNO54gvfO01eFHy28OjQ/5VXAlDiq2hHhNxVtNr55xYuWLXNkuDpuKrVODNB2EC6rdh1Cpjn3twQza5yTM1zPjgduw9YME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784220970; c=relaxed/simple; bh=xBajAebr75Al/QmBxjkQVEzD4bWqemnrt6d62r14j/o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s70RiBB/RGR6bhc/7qQiJfdZtdQsmJx0eGpwsr2wi/X/Vn6YTfvB4vZBPRnCT8PHZ8fuyxe4NP3zCwHJF3v2BiFgE54ePyHJHOUrWwkiRF/uMZtlrTIfdQx7TIDLs9qEHV2mJDm8jSVmVEiihnGEbxn/T4lOfUXkfUYvlk2HFxQ= 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=HK6Ru4XB; arc=none smtp.client-ip=209.85.222.177 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="HK6Ru4XB" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-92e7c6ec9dbso304854985a.0 for ; Thu, 16 Jul 2026 09:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1784220961; x=1784825761; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=08EQSxLVtNW+I2h2PWuzuRsz9aErjHxxHAiZ5/B9N7Y=; b=HK6Ru4XB5cWfpokzBci1nF46gk+0KG+83IFz9QMdHtLNqhxKyaIf+mCIvZNy800AF1 hxTEPIU1n7HeNxeDCCeLK0miYZmp+nVkaazCpTP7qlIW+6Z0IWTNz72o6szbL45/pJQB FE2rLQBCcGrhPlVf2fc17qpt2/5odVgAUaXBSgw7e9xlsCccmZxEp+BYt8pfUI3BBl7K BvgI16cewhqI8/0bWqvTLlcIjZWuVwVS/bfASMy1ibYQh/gP7P+UrbXvA4DW6t2KH3Cx k+onft9SD4O40qRQY3mB34HNkBkcYdPXKJN1NPlNIYdGctaI5M4q8WRByuozagzMF+An Pbjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784220961; x=1784825761; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=08EQSxLVtNW+I2h2PWuzuRsz9aErjHxxHAiZ5/B9N7Y=; b=qTANS3LqrdLLHO6hVdg8M6zT4zGpSrvYDqDBKb0CWTvH2uolf1ff9YFqCoYPi6/D9c SKP4uAEgOv9aAVb043mbrgx+WFLoZ3wLhBE10cgKUSg6IiF8SMoZmdgPdyX8M4djJpe9 pwryKYfGaLWemUwT7XqfTQjzjNqKwkcoi03Z+crEECHpxGCVRhknvdeqRzQQqtFoP7fX IU+QuRS49DBcBPTGOxCg0O7znFCpVexT2GIN6S/jmd8dEUb9iT1WK2ljepyy4dppJGih oOnwA4/4jsXmVeE4GorDC8ObLXKx4YJR4m3QfDVgDLBrO5oMmIOHN2OtLRkaIRLK8ysC nqrw== X-Forwarded-Encrypted: i=1; AHgh+Ro4pkXTR5Oi5oafuMQGzh6WB+5aR/GF81mNg5SlCMtOKHDefqSJZWcRvDpzkwxU/M/8OGLQKe5DET/i3gE=@vger.kernel.org X-Gm-Message-State: AOJu0YxQ+j+z6DJwMYcC9FkDbA/tA2i8uY/naJRpYdAQoUKbtVTo7Y/C pFRyYu9adilquIlmoJgg04sAk30/WJ1QSj+AHE03tgGeUEpZDWOTqX1Xx7W0gSK3xWA= X-Gm-Gg: AfdE7cmKYozrhojfLK58oSqW4LDBbci4/0EBQWKswMOYNo/K7Cd/RmJLkUcw6K4d6aH JiD6SThYd/WB3Cznmm8u4Eqfw2YbAb3hGLGbot3pGs2Elb7IutuIUIpLY76PZVQIDX3uH9Em28+ wTM6gVoe8S7XzEPhg0wr0t78Ebl6Hq52irIkCt4eaTGp1dMdYQyJEdszmfE66MqWUdJRWePh3zC RA4BBu22ESS3t2VrBPK7qxrx30xKqn9iPmgDoeb0UBFbJ5WIVXaog10vfeMTKrc1zjRQ0ZOY6ec ybCmayt3gMPVdk5cMZ/OY6b7aFVQ3ne56TinrDdjwe+9C4yWzpNkbHAPOtUBNQKzPcy1tuuQDx+ CUIdKWeTOVMUVnID/fq64YxFrk5yu7KNs5vJmZGn3qsgY6BOt2gIfPt1fS2esRp5sFghhqUZvKb O3XGgyHFGEZn9kuP/o1TOjaJkHxdCa65gW6o+9huKNdeZVFnd48sW+EEi/Lg== X-Received: by 2002:a05:620a:262a:b0:92e:6b16:6a09 with SMTP id af79cd13be357-93086be1fefmr1190451185a.49.1784220960589; Thu, 16 Jul 2026 09:56:00 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id af79cd13be357-930759c63fbsm956033285a.22.2026.07.16.09.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2026 09:55:59 -0700 (PDT) Date: Thu, 16 Jul 2026 12:55:55 -0400 From: Gregory Price To: "David Hildenbrand (Arm)" Cc: Joshua Hahn , linux-mm@kvack.org, Tejun Heo , Johannes Weiner , Michal Koutny , Michal Hocko , Roman Gushchin , Shakeel Butt , Andrew Morton , Chris Li , Kairui Song , Muchun Song , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Youngjun Park , Qi Zheng , Axel Rasmussen , Yuanchu Xie , Wei Xu , Kaiyang Zhao , David Rientjes , Yiannis Nikolakopoulos , "Rao, Bharata Bhasker" , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [RFC PATCH 0/9 v2] mm/memcontrol: Make memory cgroup limits tier-aware Message-ID: References: <20260423203445.2914963-1-joshua.hahnjy@gmail.com> <3ff8b23a-479d-46e8-b820-a23697587f01@kernel.org> Precedence: bulk X-Mailing-List: linux-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 Thu, Jul 16, 2026 at 03:11:30PM +0200, David Hildenbrand (Arm) wrote: > > > > First, for the multi-numa-per-tier case, I think this is already pretty well > > handled by my series. Once we realize that a memcg is consuming too much memory > > from a tier, we trigger reclaim from that memcg via > > try_to_free_mem_cgroup_pages, > > which as far as I can tell already handles the multi-numa per memcg case. > > Other than restricting the scan_control's nodemask to target the nodes > > from that tier, I don't think there's anything else to be done. > > I am not really sure about the "toptier" notion, in particular if your memory > hierarchy is not static. > > Imagine that you have only DRAM in your system. Then you hotplug some slow CXL > memory. The you hotplug some HBM CXL memory. > > The meanting of "toptier" changes, which is rather confusing to me. > I think this is a naming problem. Maybe we should start calling this "initiator tier" or something. Maybe tier is even the wrong notion here, but it's the best we have. But I agree "toptier" naming doesn't generalize to complex systems. > > > > $ cat memory.tiered_max > > tier_0 20971520 > > tier_1 31457280 > > ... > > memcgs are currently not NUMA aware, so this could be one possible direction. > > But is "tier" the right abstraction? I really don't know. > Really I think we're trying to classify 3 general pools of memory - Precious: HBM - Preferred: DRAM (initiator preferred targets) - Non-Preferred: CXL (fallback and demotion targets) HBM nodes are already weird in terms of fallback ordering, but ignoring that for a moment. Non-preferred "tiers" are slightly different than preferred "tiers". Under normal operation (assume no mempolicy or cgroup weirdness): 1) Direct reclaim NEVER targets non-preferred tiers (kswapd only) 2) Promotion NEVER targets non-preferred tiers (promotion -> toptier) 3) Under total system pressure (direct reclaim on top tier), we swap directly from the preferred tier out to swap So non-preferred tiers don't have the same reclaim behavior associated with them. In fact i'm pretty sure we could summarize non-preferred tiers as being managed hyper-lazily in the current scheme. (if there's space, have at it - otherwise you have to wait for kswapd). In my head, I think what we mostly want is: - Precious - controlled entry, Private node? - Preferred - semi-precious, fairness desired - Non-preferred - not precious, lazy managed, no fairness Just some food for thought. I've been poking at making non-preferred tiers less lazily managed, and I'm just finding this results to massive regressions. ~Gregory