From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 BBE573FE347 for ; Fri, 12 Jun 2026 16:41:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781282466; cv=none; b=I6ZoMJ5/2FVkDJIzVtX2yFyAQCLIuQowouNtSdVh4jPMD4sEFXuK8AUN7KfIeePPX4ceQknGf8xkSZjPVYEcvF90oMcItY4sM7H3Q9FhjSaJgA0sp4TH6+tSSX1DFlUunCuZhNh6GPxfkQ9quKGZZo0B66fhKacHzuHAamLTE6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781282466; c=relaxed/simple; bh=o0KCIObepWeLB7YjoDLBQa24DbSiN/ma/7Xcktrlx+c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H5G+W2y+jU8+SxqByHjQYIQQo7CalynuXCFx0hRK1dacXVEDGun1G2FYY5bxv50DowIpKjVJ2qi7LOachHDgLwtx6ThHFgF5bOaWVtAq/YHbibBoz4wR4NdUXhaDqg6TT22XFb1i6BaGG2YejxF646nUMgbkS28FL61TWV5k45I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=mpGbqHpq; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="mpGbqHpq" Date: Fri, 12 Jun 2026 09:40:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781282450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B+edMgHsajKp6EUG8qdjLHZUa6igBGAxNqzsWn/cqwg=; b=mpGbqHpqnOqlz1Vq7gOTntaJ7OPxs83o6X27H+Dm7/LR1BULPsd9sVPzfGSBfSiwhepnuZ m6s7sl433AprtRWEMaDYbKUSK+hIVvwgbXsLiZ2DnhDtA/TJZ2K4Jhy9OQgK0ZJzL3rWfg 3rT2pya67ARTrienUPLyJaINMkXBCbo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Yosry Ahmed Cc: Hao Jia , Nhat Pham , akpm@linux-foundation.org, tj@kernel.org, hannes@cmpxchg.org, mhocko@kernel.org, mkoutny@suse.com, chengming.zhou@linux.dev, muchun.song@linux.dev, roman.gushchin@linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Hao Jia Subject: Re: [PATCH v3 1/4] mm/zswap: Make shrink_worker writeback cursor per-memcg Message-ID: References: <9898f83d-fae9-e284-6b85-c7f4089840a0@gmail.com> <90730fa7-62e7-d5f4-b638-23b22a8509f2@gmail.com> <1c25650e-bf98-2863-d505-9b94c385668b@gmail.com> Precedence: bulk X-Mailing-List: linux-doc@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: X-Migadu-Flow: FLOW_OUT On Thu, Jun 11, 2026 at 05:39:16PM +0000, Yosry Ahmed wrote: > On Tue, Jun 09, 2026 at 11:18:26AM +0800, Hao Jia wrote: > > > > > > On 2026/6/9 02:01, Nhat Pham wrote: > > > On Mon, Jun 8, 2026 at 9:48 AM Yosry Ahmed wrote: > > > > > > > > > But OTOH, this does seem like a recipe for inefficient reclaim. We > > > > > might exhaust hotter memory of a cgroup while sparing colder memory of > > > > > another cgroup... But maybe if they're all cold anyway, then who > > > > > cares, and eventually you'll get to the cold stuff of other child? > > > > > > > > Forgot to respond to this part, the unfairness is limited to the batch > > > > size per-invocation, so it should be fine as long as you don't divide > > > > the amount over 100 iterations for some reason. Also yes, all memory > > > > in zswap is cold, the relative coldness is not that important (e.g. > > > > compared to relative coldness during reclaim). > > > > > > Ok then yeah, I think we should shelve per-memcg cursor for the next > > > version. Down the line, if we have more data that unfairness is an > > > issue, we can always fix it. One step at a time :) > > > > Thanks a lot to Yosry, Nhat, and Shakeel for the great suggestions! > > > > Let me summarize what I plan to do in the next version to make sure we are > > on the same page: > > > > - Drop the per-memcg cursor and keep the root cgroup cursor > > (zswap_next_shrink) logic intact. > > - Stick to using the zswap_writeback_only key, and change the proactive > > writeback size to use the compressed size. > > - Consolidate and reuse the logic between shrink_worker() and > > shrink_memcg(). Enable batch writeback in the shrink_worker() path, while > > keeping the writeback behavior in the zswap_store() path unchanged. > > > > Please let me know if I missed or misunderstood anything. Thanks again for > > clearing things up! > > Sorry for the late response, yes I think this makes sense. However, I > have some comment about how this interacts with swap tiering, let me > reply to the other thread. > I think the swap tiers interaction will be figured out over next cycle. However Hao can/should continue to push and we may decide to let it in orthogonal to swap tiers.