From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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 AED1246A5E5 for ; Fri, 24 Jul 2026 19:35:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784921740; cv=none; b=p/bPKO1EqxuGoo5tMpzbeo+5enbP6WDTKJ9U/BpUcmV1zmRVbCdGGioiV0O+03gNGSt6DCN0qv818by4fVe6ViR3UoLPLTg+lYcC+xflO+/P8P/hlMxQAFd69yNCf8pGmRdzLMl4qpQGbeg9hpUUbgSPtoQb3C0+3jyp02ZBVlI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784921740; c=relaxed/simple; bh=qe2ZGt/7PLvRmph4dApPzDPKqcOW5smLTzzdwKmTn3Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fU2oDi9ZBRZnklgyal08ZUtYiuh7Y2/eq90XlbUzuU+MptPqJiNUthdWeMJktR/3IZP1x0vYQtcxJc0G8CDLQQYhQtI1TceYk2u/91w/Ef7/NQa8ClBpnIOpCYO7SdvHyW9govJXorurf6kCPDn31n5nuGUrl3QitjhB33Ax5Mc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=TKwEiRsj; arc=none smtp.client-ip=209.85.160.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="TKwEiRsj" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-51c0006ea8eso7049711cf.1 for ; Fri, 24 Jul 2026 12:35:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1784921736; x=1785526536; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding: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=52NE9Ozo8lcWHzI33LM+g+/jHOVCaJk/+w0sPndGSPg=; b=TKwEiRsjBVOFlROlAD/xx7FkxgJb6uijW5Iealc4jpdewPbRs6SCMpJAF1KS/C1e14 hryYU5e1HDRwWFWYNTf9mSu7+ePNAh3QKkX5EpasqYRg7HXuv+pmSAc4JedQhsFbcUW8 iiPGRHK0QXBVRHHD82KmbOz1VoLSrOwuizDL2n6Buo+xOs+BBm3PTL724Bo14PsnZCHt eigabKc8jdoAEpYyfLK9Umc53Kax4qWuHvLcZDioDOJSuXMdLr6yXh2Dz7iGPWsPoPTA 8VqwjjSUF9/c9jUhiB+xmOIjT6yTKijNdVRZHO/5z9gOLkpVnpQ7dhRSOoJGSjw8Ay2z 114g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784921736; x=1785526536; h=in-reply-to:content-transfer-encoding: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=52NE9Ozo8lcWHzI33LM+g+/jHOVCaJk/+w0sPndGSPg=; b=C3WQJX1Z/JpR8HxPtkGX3Hmkmkfqxi65L9gxRbGlqv7/Krdu96EPUeHm0kKFqnTsVy 26oe9L84u5kr8ycgiIOjf9DzM7f/q8yV67FGnlirNVIH02qmuN5iJzEtXjtqPNuZpewG WmsQ8ccwXUsXExYXXyWTSvz0SPJEEoAZqFVi/b93tds2h0eQrcP1Zq0V5pgPMfVy8/qY DCZtzjN0KkyL512e9h/yLIubqjdf8ARjS7dVI+nVY29IZSi08n/HkQOPezfIq7elYqDc UCyq5ROuwPldYqjLMrLVRSjpHY/drEe5Uopjw2+3BVpDtQhRh+aQjEGSfkorK7rfN6RE rayA== X-Forwarded-Encrypted: i=1; AHgh+RrNykgYTNSWjUjI1ptjbtBcqzZy4d0BpbEas2v+VUAD5SbjoJSeMjGTVXfI2fkbo4/7xHi7TY21Y148m6I=@vger.kernel.org X-Gm-Message-State: AOJu0YwkbxgM3tjxmWRthPqJ4XvbmJ1s9L4hDQrFipprLU18ZXNw34Jp HnIKiXWCLirVm9HAog50/M4lZnXtDqvpRe94FgIcX1ZylErMylCvDvbh8+C1uKCspkw= X-Gm-Gg: AR+sD10EznFb5FZb5xkBZ4zb8zSeZlX7s/SDrGVRf/uX2xJzHrQgpDTQiaHBr3wQYkX GzqULe+UjqJ9L5JjQFSmUu3TDtXj2yqp6V0HL3CXNkiSSmgowDY8w+AkCWtw9yl+odkQWAi6LKU OXiao/oelJeDIAscoxp6W/SHTGeY5Q3yQRnlZPn0+T3l6yaLMctUmJAaF4fTjYKHXAOsFbJqnLQ odGppJQp38RAqhty6NhndOZYE9hcDmYvh7NZN4GI1NiquZpo4oES39PRmTOMxRabvRAKT1FS0XM HubxBwdV4A7NPEGHoxayzqeqxFFa9qZwLrOJDc195EN305Ola0F9TpzfJuneUfETO3FliTWQJW7 Vg1bbr48ie0OzrqE5QHnUNWdMlOmvBYd/i26CF3nDP4j8nZywtdBwMIAyQqEpk+OX3vXDvW0z4T 7O X-Received: by 2002:a05:622a:14c8:b0:51c:7b12:5fd4 with SMTP id d75a77b69052e-5283e012098mr87324891cf.80.1784921736375; Fri, 24 Jul 2026 12:35:36 -0700 (PDT) Received: from localhost ([2603:7001:f100:500:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-529a280232fsm6175071cf.11.2026.07.24.12.35.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2026 12:35:35 -0700 (PDT) Date: Fri, 24 Jul 2026 15:35:35 -0400 From: Johannes Weiner To: Yosry Ahmed Cc: Nhat Pham , Hao Jia , akpm@linux-foundation.org, tj@kernel.org, shakeel.butt@linux.dev, mhocko@kernel.org, mkoutny@suse.com, chengming.zhou@linux.dev, muchun.song@linux.dev, roman.gushchin@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Hao Jia Subject: Re: [PATCH v2 2/2] mm/zswap: Support batch writeback in shrink_memcg() Message-ID: References: <20260717085151.22822-1-jiahao.kernel@gmail.com> <20260717085151.22822-3-jiahao.kernel@gmail.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: On Fri, Jul 24, 2026 at 11:39:41AM -0700, Yosry Ahmed wrote: > On Fri, Jul 24, 2026 at 11:37 AM Nhat Pham wrote: > > > > On Fri, Jul 24, 2026 at 10:57 AM Yosry Ahmed wrote: > > > > > > The numbers generally look good, the store rejection rate is > > > decreasing and we are naturally doing more writeback which makes > > > sense. The store rejection rate actually increases when the batch size > > > increases to 64, maybe aggressive writeback is more likely to fail and > > > cause a store rejection, so that also makes sense. > > > > > > The only part I can't immediately reason about is pswpin. How are we > > > reading from physical swap more than we ever wrote to it? > > > > The same page can be swapped out once, and swap in multiple times :) > > > > Unlike zswap, physical swap in is not necessarily exclusive. You load > > the page in memory, but if the swapfile is not full, etc. etc. you > > don't invalidate the copy of the data on the swapfile. At reclaim > > time, we notice the page is not dirty, so we just skip (z)swapout. > > Oh right, I forgot about that, thanks. > > I still don't fully understand why pswpin is significantly increased > with batching here. I would hope that with less LRU inversion we end > up with less disk swapin. Probably the test access patterns are just > too random compared to real workloads? Maybe more time in zswap for those tail entries left behind with the smaller batch? That's a 32 entry window that could zswpin with the smaller batch but pswpin with the larger one.