From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 3DC8F3D1A81 for ; Thu, 2 Jul 2026 12:32:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782995574; cv=none; b=DBFYfJzrtLrfv1LgDr/Rxp7fTffVZsR5mcL74GGBYwNuNqgmnZ9WwN4Yz1Q5F59FNekSKpPMM6ai2MVtK4vbLuLbp3Eb5SSk4Ig4wCN97KuKtImDCcOSz2RmWE9BWhXoRNnCc40oXffvGxP682y4Jt26GzWo6NrjXVZwOVudHyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782995574; c=relaxed/simple; bh=8ybUXhYJmiXWSB4WXYhyKNgGmMpXifd0n0CIe6z90lM=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=l8JsatMGo5RV9Kdk7JHSX/4k4qP+dBH8rRcrlsyzC1fHn0muZ3uP0lxF85qQEyajQSt0EJ12fAhDArZAsfX6vMordlL3P3vGFdOOg30JLG/f0lEEI2vS9PQ+PKRMlQGaVS+9Pxm7XqFa0McQypQcbHVfLeTfFdAoOAoCuhNROVw= 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=WFiwVR2A; arc=none smtp.client-ip=209.85.216.54 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="WFiwVR2A" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-381018b9375so209189a91.0 for ; Thu, 02 Jul 2026 05:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782995572; x=1783600372; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:references:cc:to:from:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=AAmDZHLk7Z5SMIFVpeGPWOSrWBoOPy2gY3L8xo2kvSM=; b=WFiwVR2ALOQzTvGVKDOwmYnIeX9ZS+xT2zmqWMyTmM4w88AMPKA7Q2xusWOPhoq+x6 KTTruTt5kpVvxdibdrEq07Qmtph0qljg0/tsxive/XaMNsRxF3IHKHlKJatecaFirxMR RvPl3Wf81lKjex+ND865G0vWajS0RXaB84KhrVsyKGNEyvU5o36+o9gOpBKbtwg1guRc mjmrCJ20/gJyqulB4WZifQQ8OtmnRdtTS1/7oft5MEeXhnJcH3EuIpGb7l0fqS/9SZAx MbvSAARwGdUEZceBeKvo9BpjxGhUO49gy9jjk5WhWUFMWn55HECnGvX7Ee9mS3dx9hqf pdVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782995572; x=1783600372; h=content-transfer-encoding:in-reply-to:references:cc:to:from:subject :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AAmDZHLk7Z5SMIFVpeGPWOSrWBoOPy2gY3L8xo2kvSM=; b=UlNhbLYhkAdzI3Hg6m6Z+26wFp7Jn8TiSVTj+VguYdC2PlkYeKvrpFmfN/85XUA2hR oe9IF2IkAdAtYheErQcGnJFBpBiFLaycK8B6hHVbEG4glJ4HTMmJHugovZKszFmx+/j/ LmBHpTNFYeufGIc1V7JLEMOGgzxKcrzaMawU5Pj03aYHD5NtFMBuiTc1NE5O4Md9RemM aIwww4DBWUxurBh4Gz5OsAPreTYnoj2G2++TldqPHiJMsKjDmqTfvpef5fRcbQ9HX4yT rkg33oYQfsaIHc3e6JdimpF5A+EjH298ZBx7Topq49kVja3k6wTUvEIL95ERMDjkUAw5 u/hQ== X-Forwarded-Encrypted: i=1; AHgh+RovHRFLOW2AK6BhW0z0g/Ie1kk9xq8bxXKQpOOT3OWLC2Mqcw8b5s1hdbKJmhKgeskLi+u0T94vjZNMNlk=@vger.kernel.org X-Gm-Message-State: AOJu0YwTGtc4mZL4Yur4Bh0KeDLB83KvT7wyHYrFltSL8JkNaNNoN4gS vQuDAkVE8jlQ8hLKz2ylTCA0QHl12elgf9O28QmBNbiu1QZS7zCOJLDG X-Gm-Gg: AfdE7ckwIJJ8AIqBx1mtiUcoZiHNIT115p90iAW8i4aJt7rxpQ3AwxtwiXIJm56qope OS1AhFPJd2IZWKx4szP/25c6r7Da7xb98wCkijhL7dcXBgyTouuiUWXowXDz1uqFqaH8pM5+9Fn jgFdoJKbLuMUYVh6xYEPF2TjwPDpDNkHKYNGf/r1MuV/FpbZuIt7mDKoRhyglXq7QIcmPcBIJyV 4M9lcsFGi9cG1reZB4/fQzHcyl6lw0gBrVde++hCffa45FTOfsS9PGcu/YKxunF7v8hlIZRq+je 3luqZF0WS4S3t5ICO6RU6ZT2UYnGNUa0TKb170bjHUjeFOm2IUF2nv6hc+k46g2cVDCtK5S9TCe NeCqTB/KouPTLY4poXD59S4Poj7+A+xUfg9uNUQ2mtB0LPPHmV4/j1xTVs9boMAjx6ctH36iGhV ZVLVdKv9PSMDJb3zqnZtrpo6QFjLZTfejPvR/Z/pOGzD4= X-Received: by 2002:a17:90a:da8f:b0:380:7688:fbe9 with SMTP id 98e67ed59e1d1-380aa09b81amr6314899a91.8.1782995572462; Thu, 02 Jul 2026 05:32:52 -0700 (PDT) Received: from [10.125.192.77] ([210.184.73.204]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-380e17aa249sm1038281a91.10.2026.07.02.05.32.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jul 2026 05:32:51 -0700 (PDT) Message-ID: <5ce4035b-7f56-d1d2-2d2a-668446d870e8@gmail.com> Date: Thu, 2 Jul 2026 20:32:38 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH v5 4/6] mm/zswap: Implement proactive writeback From: Hao Jia To: Yosry Ahmed Cc: akpm@linux-foundation.org, tj@kernel.org, hannes@cmpxchg.org, shakeel.butt@linux.dev, mhocko@kernel.org, mkoutny@suse.com, nphamcs@gmail.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 References: <20260629112032.20423-1-jiahao.kernel@gmail.com> <20260629112032.20423-5-jiahao.kernel@gmail.com> <4ec2bd64-af40-8ebf-b8a8-2dd7421a1100@gmail.com> In-Reply-To: <4ec2bd64-af40-8ebf-b8a8-2dd7421a1100@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2026/7/1 19:45, Hao Jia wrote: > > > On 2026/7/1 00:10, Yosry Ahmed wrote: >>>> Before going through more versions we need to figure out if this will >>>> pivot to be a proactive demotion interfcae for swap tiering. >>>> >>> >>> Yes. Should I drop patches 4-6 in the next version and wait for swap >>> tiering to be finalized? >>> We can try to get the non-memcg parts (patches 1-3) merged upstream >>> first. This would also give them plenty of time to bake and catch any >>> potential regressions. Thoughts? >> >> Patches 1-2 can be sent and merged separately, yes. For patch 2, >> please include some numbers for the writeback performance before and >> after batching. > > I'd love to collect some performance data. Do you have any recommended > benchmarks for this? > Perhaps the following test case could work? Test Setup: - Total memory: 32 GB - zswap settings: max_pool_percent=1, accept_threshold_percent=50, shrinker_enabled=N - cgroup constraint: memory.max=1G - Workload: Run the following stress-ng command inside the cgroup for 120s to continuously force zswap store failures and trigger shrink_worker(): bash -c 'echo $$ > /sys/fs/cgroup/zswaptest/cgroup.procs ; \ exec stress-ng --vm 4 --vm-bytes 4G --vm-keep --vm-method rand-set -t 120s -q' The following comparison results were collected over multiple runs via bpftrace and the 'written_back_pages' sysfs interface: Baseline Patched --------------------------------------------------- shrink_worker wakeups 5,587 878 shrink_memcg calls 7,823,853 2,347,320 written_back 257 781,214 Conclusion: Under the same workload and duration, the patched kernel shows a significant reduction in both shrink_worker wakeups and shrink_memcg calls, while successfully executing a much higher volume of page writebacks. Thanks, Hao