From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f43.google.com (mail-pj2-f43.google.com [74.125.227.171]) (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 B59BC477E3B for ; Sun, 4 Oct 2026 18:14:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791137652; cv=none; b=dK01H/hbp9VKrDXslB/EUfWlnVLHYhuTGVN0jJUnqSIsNcoCjx6XM+YKsujrIuDmyftQNxagJ7/OqM2Tk1NVe0lTVxdoHwzW+c5gQv7Vef3cmG5XFFxKpchNtAh6glzuNtUNLcSn0vcrlW7R68vH8Hvf3YL9vm9C9zAdTsA/JeU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791137652; c=relaxed/simple; bh=sjH5S0CNZClDmqdFY8S86gTYCINMCORIQDzBcILuZbw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A6YhtHsamHI8ZXTtcA426K6AqzPQ4jnqrEWIZtfi9Uiqo8s9/kDVhay63QckCIcO07DFyjkaFng+Ad48AybM/292X0/m6gJljmsL62QoZflmdUO1wRc/1uwN4JByDpiu0d0f4p4AxKV4QMccmXhyLBvoCp7UokUP08um2052T5o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=K4Sa1s33; arc=none smtp.client-ip=74.125.227.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K4Sa1s33" Received: by mail-pj2-f43.google.com with SMTP id 98e67ed59e1d1-3a4c8262465so808856a91.2 for ; Sun, 04 Oct 2026 11:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791137648; x=1791742448; 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=zvp184+VDrAAELa45MrIVjzHZuD6h0h7teUaAj2z138=; b=K4Sa1s33e0topBLGrjJINZJoi62x44og/j03tLJmjWt2c/pJvzX2HTGqfrHcMxLOGo KxzYBuopU972XPuBVEcR0ycGt415fw4raN5VEPo2z6muL17lWZ/HIG88g123LWJTPd9Q rirdz9jjIW7qf6CNJ02pHhxBu7iA1urwiQXBk8Wvo5pIeMbSY2jZaZ/D1EBhVzv2BTh6 jqs959cePI9HiTQN5HMLqSTDbZ4rKf638sNEpvZ7ucTiJSi0gF2+JfvYODsxEmFKBRLK o8+oSJ+fc86F3abO3LxElskwxBc8NX974Oso3GKIkN2Vqx+k+AED2wHfPestHNGGQ+cW BnyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791137648; x=1791742448; 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=zvp184+VDrAAELa45MrIVjzHZuD6h0h7teUaAj2z138=; b=WpP6Mpu2d2YxZFWVymZg2SYOL55JBGq/5FBhdK2XizlGko6c7XKZvb0Ov2tGYd1nf+ YmRQ15K0f32dZSJ8rxDvghnMrtUbHnBVt/SIqn9zhhb54Gumn6XL/Az5Xf8Re4qbNd4B 7IOux91Q1IvVuW107z4WGIIoujGSeO3XPWMXn3c8xSgJ+sEGRirSto+pc15KtphYEHU7 y1mkRneQjYNsYlDkrlzXBcnGnyvMYLiNkSPEra+7WKSGlRVdFIBDfCWPBdX5I2pW1UWq CtMbcWM6xLiIeYuQ7X+S2HSOrQqIer9dnDzDIRqgmPWc911ugnvmBQpUBHXZU4Dh9wQ/ IbYQ== X-Forwarded-Encrypted: i=1; AKwUvBynB9tbeFCbAYJeuX2RiiRHmjw2kulhkvsfqu4Oja8lXZmpRJklhxUxpdn0fgtpAj+rJxLh0B/+r4E=@vger.kernel.org X-Gm-Message-State: AFq9FYKUGadT+12cPnWme+qt5n+C57j0SoFXdniW5n9sdI1k56GDknpz FSJmmXzwf/eZIX1lSPX2e3oqb7jrhFYQZLXSlIB+NNTs0FjEHqe4rDHz X-Gm-Gg: AYBFou1mwNeCjMQy74ex8oKkHk6WXGlvyZMFpl9LbwLcGXKLThQp3z0PGoc7cRXgZb6 RsyfAFb+xno50o4W9EcwuAJKfQpgt/vrAkPUeRo2b7RlVvTgr/Q27eqnAQWk1CjWDEWV4YY/4rK CIWmUWKJTXj7D8+6iT7C/oV47suZFN7ID8kYB+aJpxUcvHCdV0zms8STc6z4ES2G1Uy7qdeRgC9 IukuIrPsMUvZGpwH9rS2RmhV2QT45JF2DLEvr9ZmfQFBSeuRW2ENg26qE+ae/I0xSWNfP1jsHuK i2tCchUmZLc2v3+Or1rD0zE036NoLdrKn1zhNpaBHrm/alMEOTfU1X/rR+9nh6RzMYk2Xvnbar/ jJNnn+QoDiPTcZNjSaJAQ4uagJcwjQOAp0d+LHei3yHVRW2N/bTf/K7ON4Cy31+f7q3+kmXkgzW 3Rzt+WYnd6lNJTKDd1I+yBai7S3sYR7IY196xYsKJRnDHRaJmLyS3NpN9MVXi+Ydfj7U7TEh4bW ui/BxPbipMWRzcJzPeOTjOHy9jJLKDiUp6q93qfOw== X-Received: by 2002:a17:90b:4ac3:b0:3a0:a781:2c39 with SMTP id 98e67ed59e1d1-3a6ce3a978dmr7662178a91.7.1791137648512; Sun, 04 Oct 2026 11:14:08 -0700 (PDT) Received: from gmail.com ([220.85.166.190]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3a78d59f1cdsm7460304a91.0.2026.10.04.11.14.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2026 11:14:06 -0700 (PDT) Date: Mon, 5 Oct 2026 03:13:58 +0900 From: Youngjun Park To: Matthias Goergens Cc: Kairui Song , Andrew Morton , Chris Li , Baoquan He , Johannes Weiner , David Hildenbrand , Michal Hocko , Shakeel Butt , Kemeng Shi , Nhat Pham , Yosry Ahmed , Barry Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-api@vger.kernel.org, Alejandro Colomar , linux-man@vger.kernel.org, Karel Zak , util-linux@vger.kernel.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, "Rafael J . Wysocki" , Pavel Machek , Catalin Marinas , Will Deacon , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Shuah Khan , linux-kselftest@vger.kernel.org, Kairui Song Subject: Re: [RFC PATCH v2 0/4] mm/swap: reserve swap areas for deliberate offload Message-ID: References: <20260926045517.3458413-1-matthias.goergens@gmail.com> <20260928151944.2686626-1-matthias.goergens@gmail.com> Precedence: bulk X-Mailing-List: linux-man@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: <20260928151944.2686626-1-matthias.goergens@gmail.com> On 2026-09-28 23:19, Matthias Goergens wrote: Hi Matthias ! > > Just like we already have a "swappiness=" parameter in the reclaim > > interface, perhaps adding a "swap.tier=" would be better and much > > cleaner to achieve the same goal? Based on Youngjun's work here: > > https://lore.kernel.org/all/20260916183437.2946306-1-youngjun.park@lge.com/ > > Thanks, I think that's the right base. I tried it: on top of > Youngjun's v11, a "swap.tier=" argument to memory.reclaim is about 40 > lines. In a VM with zram at a higher priority than a disk swap > device, and a cgroup whose tier mask allowed only the disk, ordinary > reclaim in that cgroup stayed on the disk, while memory.reclaim with > "swap.tier=" pointing at zram went to zram only. There is an earlier attempt that may be worth a look. https://lore.kernel.org/all/20260618044857.69439-1-jiahao.kernel@gmail.com/ If you go this way, the discussion in that thread worth refering too. > What it doesn't cover yet is reclaim outside any configured cgroup: > under global pressure, a cgroup nobody configured still reached the Right, so for now every cgroup has to be set to exclude zram, unless another idea or more code covers it. > zram tier. So for v3 I'd like to add a system-wide limit on which > tiers pressure reclaim may use, on top of the per-cgroup settings. > I'll wait for Youngjun's v12 and build on that. I have looked through the whole series, and I will keep this use case in mind while working on v12. :) Also, to share what I had in mind, I was planning a sysfs interface for each swap tier, /sys/kernel/mm/swap/tiers/ (exact naming TBD). Maybe the system-wide limit could be handled there as one of its use cases? Let's discuss it in more detail after v12. Thanks, Youngjun