From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 8985B29ACDD for ; Wed, 25 Mar 2026 07:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774423288; cv=none; b=sCnj1AGngwraARM6CchEkWerHw/daxCJThw7exJ0jP92ifAek4d01dRf3rWDqnQvmy6F0k+kMbMF0GvlCtELjed5xaGll5Sj2epW2O8MPZWTZU9ASGZP029KjrqcDoecoV67mFEC0YYMz+3awF1kOA+KgUNvlijlIjiUaD/PnD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774423288; c=relaxed/simple; bh=z973FCycnB3TujmEEQejW3UZf/uhTwOxCrAga9oobyQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JUT1qd3cYm0JWZPFUXa1bzf8EWZjN8nCiyZeLFlJUINVCIboi9CFvV+CMpyDW5p74TG3UsNLttOTN/2HBvz2oUvyjhuBXTqVz/GUAB0BnWkQVgHLnsH7ghCdfsR1x+StEsdKcmJXn+yE4Mp+oWWwjWQ/Y9zaONw4Vs4aYrVYZwM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gbhjIhPd; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=c6WSOTqQ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gbhjIhPd"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="c6WSOTqQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774423286; 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: in-reply-to:in-reply-to:references:references; bh=CTBVdjMl0gw9L96tqaRdKumbhrIsABDruk8W4kuVLG0=; b=gbhjIhPdIhRHEg+G/N3ulIE0Xk6OrT1eUaDsK1vs7Xb1I+YyBZHOx2/II5/Ojy27wKUB1H oNs1jr8xI93IGpZAfg8o+eM3NsCKJpFiwSlly0dGChZZg8IEIYjcomFbtuzeJLwXtBtnZ5 JKJSpBdKAP32LSrKnwtkde4kDFEYBiM= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-111-E-Ll0oa0NWiMBDcJXyiXIg-1; Wed, 25 Mar 2026 03:21:21 -0400 X-MC-Unique: E-Ll0oa0NWiMBDcJXyiXIg-1 X-Mimecast-MFC-AGG-ID: E-Ll0oa0NWiMBDcJXyiXIg_1774423280 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-35b96fbfc64so22721670a91.2 for ; Wed, 25 Mar 2026 00:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1774423280; x=1775028080; 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=CTBVdjMl0gw9L96tqaRdKumbhrIsABDruk8W4kuVLG0=; b=c6WSOTqQXs2GtnBCt8ReLpDdy0OTLAmQWueNTNtWd1+O03g+WQwGrZTQ0RHq6EuJZQ Iq5MC2RNXM9Z12TxE0IVFhuAjJXo/Uzs/SKmSr1ZGbI30CzfwHNKJaUxBHHkEF+oSnhc 0l9k1lj9krv5si8tAQkYy4A1XUeZCUKmcZ+Ly2yEU/46jti6HgvUp3LAmLVPe/uNTCzI bZZiRE0nvI55QrnxxFx0eRnqBRHvH8tlq8O1gZIkrXJNXWuJkPNKUHhz4Gc0xtWN8bsD vl3JCorHkxxS4W/mzCpWhr1hfKWfBOzRcGUYslMXUGekMtiN8iKq8el/8GPOK/KAHEBJ YWkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774423280; x=1775028080; 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=CTBVdjMl0gw9L96tqaRdKumbhrIsABDruk8W4kuVLG0=; b=BSQBW/UuquWkQS1crUyJzBhf62euTLQbnu61AI0eTywZbKZwSGSiz16rOTKaoAR+Dr EJgicJYTOysZbxSDrBor6R5oY+0svvJ/dVJ/f9loLzM3i+kEv5/KjYMNgvZP3+rTd54Y RE54zoRYDAEBfz+DB2mKhVtDM2efV4kQL80ALgySpSvV43ijJYLs5k5QmgFlzEz18vrH QFNp5CVn/oaZcLjZA3ZuYsFganit8/S6qafbuYl5kkFrX291wtAIIlY31TyKOGOBA2pZ ZRqQhIm9HiS20Yh5G+Hg7eQ3v9yzR+k5cdwRAv89oqUO2+FX0AwaHOB/s+uQdr6BlVuY Rerg== X-Forwarded-Encrypted: i=1; AJvYcCW3HKmQWvEA2Bxxr69A/t0BNchP3Cfn9V/hbb4nWIYYuRjCw9rEYktGA4PYoNhG9RzWdhu/SStHASadcn4=@vger.kernel.org X-Gm-Message-State: AOJu0YyUk4mNxCHEEI8KyBqZNBVkSu8MXSQPEHKRzrnqd18pDdIVVxTL 2M47Slm/3HZCC2uE5QenVWxgrfWneKyyRG28BCGCBdK3behXCe3BB2GLn/InlIzD3ze5j7JM+gp FwxPzc6u/4ht+D6E5SW3mF8c5dwHUK5m7RhbRCTJrvX1bgj0cNTWnVirFpEoEmqgjvA== X-Gm-Gg: ATEYQzyCzZUgEHO367HbbdFAX/Q7KG3pM2QsZ3rCNEJ0d8C4oZ7vhg5qBVLa8jOoehi rrfQaaEh2unKRCuS0ONHglivyClBlHyyOpfczang/oAaaCA+iOT1miiym/gRNnn7MHuF4L6SQjp UQ+cWw7uqazIta+SxBW3ahkeFy/m7vgLQ57M6U3VGHkqF5bXmu+kiHZE9RdHQaoI/Iy1/iVVGHR LgZ5WXO8Et1tZqosTiNvla0g6dYoRLpd6B8O74LTq9T+x6XfmVFv+4QgCIuwyMoLwoQDwWbqMKh QNlPLIbBaIz/6dcsH0w1DPNLHSunFvNDdDHXCRYlUPDzcsclIlkMTvLsvZKnwDlzRaEfraf+iMR LLNX9MPo/g71XngmCfQ== X-Received: by 2002:a17:903:1b28:b0:2b0:659e:97bb with SMTP id d9443c01a7336-2b0b0b0d6fcmr25894285ad.46.1774423280287; Wed, 25 Mar 2026 00:21:20 -0700 (PDT) X-Received: by 2002:a17:903:1b28:b0:2b0:659e:97bb with SMTP id d9443c01a7336-2b0b0b0d6fcmr25894045ad.46.1774423279806; Wed, 25 Mar 2026 00:21:19 -0700 (PDT) Received: from redhat.com ([209.132.188.88]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b083516908sm210835885ad.1.2026.03.25.00.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2026 00:21:19 -0700 (PDT) Date: Wed, 25 Mar 2026 15:21:17 +0800 From: Li Wang To: Yosry Ahmed Cc: Andrew Morton , longman@redhat.com, yosryahmed@google.com, nphamcs@gmail.com, hannes@cmpxchg.org, mhocko@kernel.org, mkoutny@suse.com, muchun.song@linux.dev, tj@kernel.org, roman.gushchin@linux.dev, shakeel.butt@linux.dev, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v4 0/7] selftests/cgroup: improve zswap tests robustness and support large page sizes Message-ID: References: <20260322061038.156146-1-liwang@redhat.com> <20260322091851.e965d3a2f0d6af5bd985407f@linux-foundation.org> 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=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Mar 25, 2026 at 02:17:42PM +0800, Li Wang wrote: > > In summary, the problem is that 'zswpwb' does not update when zswap is executed > > under the zstd algorithm. I'd debugging this issue separately from the kernel side. Plz ignore above test logs and conclusion. > I forgot to mention, this issue only observed on systems with a 64K > pagesize (ppc64le, aarch64). I changed the aarch64 page size to 4K, > and it passed the test every time. Well, finally, I think I've found the root cause of the failure of test_no_invasive_cgroup_shrink. The test sets up two cgroups: wb_group, which is expected to trigger zswap writeback, control_group, which should have pages in zswap but must not experience any writeback. However, the data patterns used for each group are reversed: wb_group uses allocate_bytes(), which only writes a single byte per page (mem[i] = 'a'). The rest of each page is effectively zero. This data is trivially compressible, especially by zstd, so the compressed pages easily fit within zswap.max and writeback is never triggered. control_group, on the other hand, uses getrandom() to dirty 1/4 of each page, producing data that is much harder to compress. Ironically, this is the group that does not need to trigger writeback. So the test has the hard-to-compress data in the wrong cgroup. The fix is to swap the allocation patterns: wb_group should use the partially random data to ensure its compressed pages exceed zswap.max and trigger writeback, while control_group only needs simple, easily compressible data to occupy zswap. I have confirmed this when I reverse the two partens and get all passed on both lzo and zstd. Will fix in next patch version. -- Regards, Li Wang