From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 ECA5B3FF8A4 for ; Tue, 24 Mar 2026 15:23:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774365812; cv=none; b=TB0mVqR4UNGSWkmdFgKfLG66WwTC1S99qx+6XgMitMySCswLT9OKjDXj/9evcezic7I84Tg9b26AmrfjQ2gc8oc6U5zBIfnJynido/U2UTwlE1txxlddRJ29fixWEVr2tw/mH8Ju7W19dSPqX+COzIadXn5RDVXqIeG9wx8S/Tg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774365812; c=relaxed/simple; bh=eBIb1ZNnQtgJPCgnufRRyjX7zGSQdC1Es+T2piwApMs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gxdywSAYlS6AxiqSkzIKUKHG5HvDgiSkq3MGEo0LCFqDkZ7+kj0G/uQxpJzgf5vWM5w+4fIG0toNv2LC7p9y8E786WlPq5NLLxwqyLjlBwNLxxLVhkCaRs/rtZzIr3up4at+34umQfvwLJvCf9cpdA0CyS6qORw4whqTXAtHiSI= 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=DmqjbMUP; arc=none smtp.client-ip=209.85.219.51 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="DmqjbMUP" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-89a14be4733so15593886d6.2 for ; Tue, 24 Mar 2026 08:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1774365810; x=1774970610; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=dN9bTdcC5or2P8tjA2XnE4l+JSY6/+Dfgf14OK19Eqo=; b=DmqjbMUPHBKQaHQAIHGZlBLsswjFXHTYze99zHsAlCvVk0cWNQgPhW7Vl/m2W9/N6a iOVQZSW4sa0h1ZwZFA4d6RjskDb2EUN9tJA9E+DIJMaTEzMNpEi4mfqRve4Erq6MB+8Y ZFX0JriZcR7rfVl9LcQMLZb2kkJ8a9FjTXqGlhK4xwn5MwA9LxDs5wL2eQ+3Otp6pwBW AKnPjgvoN3IW/yjdKQbASJnHEQnTdV8MY9taR+LGuUUNtvM1OruKktJi4WpNyKSkVXE4 tz3z6ieiInvLZXBv1F70cSHD/gJ79EsFT3tbERIKgTurq9VZjqHAcHwrOp01Km54i6VG skQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774365810; x=1774970610; h=in-reply-to:content-transfer-encoding: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=dN9bTdcC5or2P8tjA2XnE4l+JSY6/+Dfgf14OK19Eqo=; b=biPh4CpDS1vmsVdqUE0p859m/Dftv0Ouj8ofRew1dKqv8B3ZcnWYedCTkn3wBW/qEp rDzIxXYkuP0Aebfy1YI4pu6tBEpJM5tjd+QXSgwxW3aOsJawKcTht72WW3q7b2vMA+UT h364Fh957tD6TJPQWDRCINxsBOgLWFNjsTfVLu0ypfp5hJggjztd8y+Xmew3vUejI/d4 Lc+W+LRsvbZVhnioBzcL7OK+1798+PK00VSP5BGw61Oq3dlV0NItGHVTXu5MGlmv7Fxd q+jYGA+EWWjvPDjMgDVsEI8OsasCQD+Myd4P1LuaiikuoAz5q+7crIopHlOFFxhAHUI1 1VLA== X-Forwarded-Encrypted: i=1; AJvYcCWqZvBP0f44HgQtlpCR4/WMwU/JtjbBjzdW5YAJcQxM0Hfvv/cREGQiCDpAFRVB0yZgU0myazED9MxNkrc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx19Z83lFVHW1hwmCCtS55wDEKoiwZdJoRJ4L+wBHQ94NVbDvQq KuKZ5DLQlKSQWP0eNI6EXLD2Wa4Wmz4OdEpP5utWZftPltw0B5Hnv58RRXUanGeLjeE= X-Gm-Gg: ATEYQzzNTHvMu14HCbcuw6pCTkH/1tEHOPdS3Zqv7CF74uLN2Z41c50MZQIN9XtHHZ6 H+bJ4gNYhRdOzIgQYBOFodsV88qiJphlZWGXcRpuREf9PU2XEzjdTztVQl0EtVdxoKpITo7Wl35 wbrPquSFzWBuYI5ajZoDk0E9mwJUq5Tqk+dKc73q940BqJku0zgC/uqXL1IbR6cx5B7sGe/jXxb F1DMxFTnSuH8QQJsXZNIYs0IIvf/A3OSzda7Z5Dvfblr4A9MYFx0hbZzKiVKGnGYv+BgCveW44G TX7c3mhPfOPQ1ZMWSInXK6iliMZ0+kyiRFrKzjUgkjaMEcJ+AuotjUQzKyARYbj/lNb5eR3Q4IQ D+xvOxVKyUqr3D8/kaGb43wjf/cS8J5UDjNS86qVqlULFqnBNj1pXhHgIjYa9Nw20ow/Lp1ZRbW BqiRRvoyBFAHT4LkqCdQ== X-Received: by 2002:a05:6214:3306:b0:899:f929:d85b with SMTP id 6a1803df08f44-89cc4b1be87mr159996d6.61.1774365809892; Tue, 24 Mar 2026 08:23:29 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F ([2620:10d:c091:500::de62]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-89c85335745sm117576556d6.32.2026.03.24.08.23.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 08:23:29 -0700 (PDT) Date: Tue, 24 Mar 2026 10:23:27 -0500 From: Gregory Price To: Donet Tom Cc: Joshua Hahn , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Qi Zheng , Axel Rasmussen , Yuanchu Xie , Wei Xu , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [RFC PATCH 6/6] mm/memcontrol: Make memory.high tier-aware Message-ID: References: <20260223223830.586018-1-joshua.hahnjy@gmail.com> <20260223223830.586018-7-joshua.hahnjy@gmail.com> <90749965-ebc8-43b2-92e3-baec5f6e3de0@linux.ibm.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <90749965-ebc8-43b2-92e3-baec5f6e3de0@linux.ibm.com> On Tue, Mar 24, 2026 at 04:21:06PM +0530, Donet Tom wrote: > > IIUC The intent of this patch is to partition cgroup memory such that > 0 → toptier_high is backed by higher-tier memory, and > toptier_high → max is backed by lower-tier memory. > > Based on this: > > 1.If top-tier usage exceeds toptier_high, pages should be >   demoted to the lower tier. > > 2. If lower-tier usage exceeds (max - toptier_high), pages >   should be swapped out. > This is not accurate and an incorrect heuristic. Transiently, lower-tier usage may exceed (max - toptier_high) for any number of reasons which should not be used as signal for pushing swap. driving swap usage is a function of (usage > memory.high) without regard for toptier / lowtier. > 3. If total memory usage exceeds max, demotion should be >   avoided and reclaim should directly swap out pages. > This is also incorrect, as it would drive agingin inversions. Demotion is a natural extension of the LRU infrastructure: toptier active -> toptier inactive -> lowtier inactive -> swap if you do (toptier inactive -> swap) you have inverted the LRU. As far as I know, from testing, we retain all the existing behavior - we are just managing a limited resource (top tier memory) to manage the noisy-neighbor issue. So... > Should we also handle cases (2) and (3) in this patch? No, I don't think we should ~Gregory