From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 0834F3F5BFD for ; Wed, 17 Jun 2026 12:27:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781699233; cv=none; b=RnKrSRztsY/PpPhVCrRaUYEh9vggFYmxtSOQWJQNx4IYTpuvtXNJiGN8gY1A6w+yNbyWFeHZtVcoDFrOI87Xr1tI4jnCV60dNb/lNJgqpS+yu5uH7g1DiNe/b7skfMD888CmnSQus8e3Bx7yw2VI5KVSzkg8aoj9JEQLngjAFNE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781699233; c=relaxed/simple; bh=4P57JPApK5Duv4SS9/YWY73JFxrYB4MbrvSBwzJXzxo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EUGKt7ODikNmiRju6VJdCcSHpOCQISF87keGWW7YgDhXvWoJ3eomCIG64oYhGz7UI5vfXuNAGfZw4tzmHgDTx823vIZWwBY9VZ8/Y6/DGgmrme4/Hvl//0rtxjFKYvpmlVKLg3FzjKfmRmYxfK0WIzcAPdXImoRrVh65atrIpe8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=TKZTu3iv; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="TKZTu3iv" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-462bb734793so456919f8f.1 for ; Wed, 17 Jun 2026 05:27:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1781699228; x=1782304028; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fIkFLHlBYwD2iiV0FJSSocLP/zlZq6rIN3ROwVp13XE=; b=TKZTu3ivuCjH0qCjoVkB/l1pXgWZ8BY+PBhzCSRh4hoaHBbwnjTl+vrtleJ4/8oTj8 Uw2ViuEQTDi0qU5RyGCtlcWVfN0VS6fBQwnj3sUQCMXU2MrTWLlHcgnzSqweGOkz67Uc LeoTX82Hwf06xf6O8dt6dQQThaDdBxPlqqcbsmNqlsOJLs3rKyiBN9qVFAsMadtJau1G YeOmPpuuWQhczFABUXn00LuDMmyG5OEBfd9D4TIgUrDY5JcggM+7rUcs/CXa3rxt99XH /f33pcreFbyXE0ns+018rp86SJQ2qMiGtKhnQSLvFfBZwt5wx8arVi5DbIeAv1qkMNDN cMlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781699228; x=1782304028; h=in-reply-to: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=fIkFLHlBYwD2iiV0FJSSocLP/zlZq6rIN3ROwVp13XE=; b=SKSOESrTA1vE2B+4ovfCtrFjO/DrLVsnu9hyP5W5bz96PnZLrB+l9HcVPIZ5u44egW 1ZlgfB3gFvMnt3OhrjeoxHGZkL3wu4n5R1PDkVIU9tT5LV4CJEXSLrz+JtDojjdroWIq fzI9jEMQbgIAjdsrbyDgJPMhOKaxu8BjVs6xYuFf6syJlZXN3BERDs2ZdbCy+D7R+BXE FETevhQMNguYWcgSt4PX8Yu/BngctA3WAlzyyLV3m/hlieNySO9zHAMRaGT5UWRQEzTA Os06I84z2FGuOzHo84IRh607H9HKjZ9/J0Wk7651wWVEFk3Gv5HLm2Agdog8i7Eb2OE7 6vsA== X-Forwarded-Encrypted: i=1; AFNElJ+SQaHXTzuxmDI7UArCMcf41OrcgwuglJRBSvSUkcWDIXX0WuLPVp6bar80+0q7HXSlxzL4YOObZvipvbM=@vger.kernel.org X-Gm-Message-State: AOJu0YzjOnVYKMAllnDXP+9qfz54dpP25dxLGBgAcO91i+DZTJqu0uE8 H8WRoqlWMcRMR37Dzfa/zt5PXNREIWj00DyLf2w+niaYY/L7ba+/syw1aW1nCpxSZ5E= X-Gm-Gg: Acq92OG4YQO8rido/17UvgXNd/d3VTeS3SXL6FKnvl0iMLpeq/FGEs0zp4NzAYq8Anw rnsk9meGvkLSo+iMSqp/inuJxChnmugLb7z7oHGXJrLw8hz/guTX6wq89M1ZcK1EvqBxeUQabV/ AH5GAvSL1Dsgk5LgXCT9piLSZL9/BVxvUJ1y4LvbsKYPSoj8jrbZcPJ8p1Dwvu1GRXThoexbRzI fsAPKySkRTJcCHTVYS2wohxtP6yKbaYU3nqpMrSRv1gXrLtbES/No52cHT+tCkdKrRxg3VUFUi6 LR0EvbEjUmfZgWyidAJ+s5pv6oIWIWOj8v+Ta68mRiBtatSpl4twQJn2pr9fJA4pPw70NYsRF/e cLKA4MenrkM5NOoIy6YeOc+lE53ZhQWtvP6ajFcl20QXXww5HyU7WZwkcurxt500DEvclwJNWDh zIs8CvkON3rrY3B19U6w== X-Received: by 2002:a05:600c:a30c:b0:490:be1e:6ce6 with SMTP id 5b1f17b1804b1-492333aead6mr55511115e9.9.1781699227889; Wed, 17 Jun 2026 05:27:07 -0700 (PDT) Received: from localhost.localdomain ([62.77.90.70]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49230a9b45bsm130662975e9.15.2026.06.17.05.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2026 05:27:07 -0700 (PDT) Date: Wed, 17 Jun 2026 14:27:05 +0200 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Li Wang Cc: akpm@linux-foundation.org, tj@kernel.org, longman@redhat.com, roman.gushchin@linux.dev, hannes@cmpxchg.org, yosry@kernel.org, jiayuan.chen@linux.dev, nphamcs@gmail.com, chengming.zhou@linux.dev, shuah@kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Hocko , Muchun Song , Shakeel Butt , Yosry Ahmed Subject: Re: [PATCH v7 6/8] selftest/cgroup: fix zswap test_no_invasive_cgroup_shrink on large pagesize system Message-ID: References: <20260424040059.12940-1-li.wang@linux.dev> <20260424040059.12940-7-li.wang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="npkgor3mtzc7eyn7" Content-Disposition: inline In-Reply-To: <20260424040059.12940-7-li.wang@linux.dev> --npkgor3mtzc7eyn7 Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v7 6/8] selftest/cgroup: fix zswap test_no_invasive_cgroup_shrink on large pagesize system MIME-Version: 1.0 On Fri, Apr 24, 2026 at 12:00:57PM +0800, Li Wang wrote: > test_no_invasive_cgroup_shrink sets up two cgroups: wb_group, which is > expected to trigger zswap writeback, and a control group (renamed to > zw_group), Aha, it should stand for zswap writeback? Then zwb_group to avoid (my) confusion with zsw_group :-) Although the original names were already well descriptive (both groups are expected to have some zswap). > which should only have pages sitting in zswap without any > writeback. >=20 > There are two problems with the current test: >=20 > 1) The data patterns are reversed. wb_group uses allocate_bytes(), which > writes only a single byte per page =E2=80=94 trivially compressible, > especially by zstd =E2=80=94 so compressed pages fit within zswap.max = and > writeback is never triggered. Meanwhile, the control group uses > getrandom() to produce hard-to-compress data, but it is the group > that does *not* need writeback. >=20 > 2) The test uses fixed sizes (10K zswap.max, 10MB allocation) that are > too small on systems with large PAGE_SIZE (e.g. 64K), failing to > build enough memory pressure to trigger writeback reliably. >=20 > Fix both issues by: > - Swapping the data patterns: fill wb_group pages with partially > random data (getrandom for page_size/4 bytes) to resist compression > and trigger writeback, and fill zw_group pages with simple repeated > data to stay compressed in zswap. I'd have expected that having both equal (i.e. both random to fill up more easily) is what tests the effect zswap.max upon writeback most precisely. > - Making all size parameters PAGE_SIZE-aware: set allocation size to > PAGE_SIZE * 1024, memory.zswap.max to PAGE_SIZE, and memory.max to > allocation_size / 2 for both cgroups. Makes sense. > - Allocating memory inline instead of via cg_run() so the pages > remain resident throughout the test. What is the residency good for? (It doesn't matter AFAICS, so the change seems gratuitous and code diverges from test_zswap_usage().) --npkgor3mtzc7eyn7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJEEABYKADkWIQRCE24Fn/AcRjnLivR+PQLnlNv4CAUCajKSlRsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDIACgkQfj0C55Tb+AjrLAD9GBYJlDuakfCppd9zM7AV pVNB8ypWNBY5Zblvu5XqtjwBAP+ZAbviWaThkRKtDNFKUvOG/ItMxC0RjON1YZma WNkB =KrLy -----END PGP SIGNATURE----- --npkgor3mtzc7eyn7--