From nobody Fri Apr 3 01:22:51 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 B8295273D6D for ; Thu, 2 Apr 2026 06:38:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775111887; cv=none; b=bXDw7i3evgm6ygm2pEGhE/bTLIqyOdasE2np3zrn2UA0KQYkgNAsvrmjH1YNS1CoDwH7Gr1t6Yu8MWO4RIPloJkVye7SxYk3vGGcTqNbx3ekdVPswWR3QZLHe70dF5jzXYQlBL+UitX/+TlHodM6gRdKEyZEP0g87Nq3gop/A9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775111887; c=relaxed/simple; bh=q1GckCjEhhZBcM7y4Oxt5urJeFjwq1V1kbTMG93+tOw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uvkkLl09WkSco4JvBVVtdTj0D8VwuPjKkH8D2vGDaDqIF1QGu55IW20ox7Gf2i65Tnshtn4qcXbiWzToJfm6NncznE9m5toyONuWebmrDabHy6wR967lvGjlZZQaTCcq0kLQu+91BEEW/Fy6rD5LEMF6Xkv0KpFBnuosvzOQV5w= 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=KgLsrre/; arc=none smtp.client-ip=170.10.133.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="KgLsrre/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775111884; 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=X5U9ZvN1zto4I+eOsqlOo20LYK4uAdfElmrPhMe08Tc=; b=KgLsrre/t+A4YnGlEiBrlZyHWFjhXGYvuDj1g7bKH7SKgjaUrun8k0/nnaWk4v8wltssBC SA1kNw5RiaJzOQx/49yHYByohg3i1BroOsNBpM9ZKwMl/K5nolxLYDeYjpiIybLFBEwrg1 xxZ4eZ0ta6xiLaLNAXjYlb11xS/aQpQ= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-132-bEp42vKHO1aKWY3Kdwl7AA-1; Thu, 02 Apr 2026 02:37:58 -0400 X-MC-Unique: bEp42vKHO1aKWY3Kdwl7AA-1 X-Mimecast-MFC-AGG-ID: bEp42vKHO1aKWY3Kdwl7AA_1775111875 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8D506180034E; Thu, 2 Apr 2026 06:37:55 +0000 (UTC) Received: from fedora-laptop-x1.redhat.com (unknown [10.72.112.158]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B3EC21800351; Thu, 2 Apr 2026 06:37:46 +0000 (UTC) From: Li Wang To: akpm@linux-foundation.org, rppt@kernel.org, david@kernel.org, hannes@cmpxchg.org, yosry@kernel.org, ljs@kernel.org, Liam.Howlett@oracle.com, mhocko@suse.com, shuah@kernel.org, chengming.zhou@linux.dev, longman@redhat.com, nphamcs@gmail.com Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Michal Hocko , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Muchun Song , Tejun Heo , Roman Gushchin , Shakeel Butt Subject: [PATCH v6 3/8] selftests/cgroup: use runtime page size for zswpin check Date: Thu, 2 Apr 2026 14:37:09 +0800 Message-ID: <20260402063714.55124-4-liwang@redhat.com> In-Reply-To: <20260402063714.55124-1-liwang@redhat.com> References: <20260402063714.55124-1-liwang@redhat.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-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 test_zswapin compares memory.stat:zswpin (counted in pages) against a byte threshold converted with PAGE_SIZE. In cgroup selftests, PAGE_SIZE is hardcoded to 4096, which makes the conversion wrong on systems with non-4K base pages (e.g. 64K). As a result, the test requires too many pages to pass and fails spuriously even when zswap is working. Use sysconf(_SC_PAGESIZE) for the zswpin threshold conversion so the check matches the actual system page size. Signed-off-by: Li Wang Cc: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutn=C3=BD Cc: Muchun Song Cc: Nhat Pham Cc: Tejun Heo Cc: Roman Gushchin Cc: Shakeel Butt Reviewed-by: Yosry Ahmed Acked-by: Nhat Pham --- tools/testing/selftests/cgroup/test_zswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/se= lftests/cgroup/test_zswap.c index ed257d464bd6..516da5d52bfd 100644 --- a/tools/testing/selftests/cgroup/test_zswap.c +++ b/tools/testing/selftests/cgroup/test_zswap.c @@ -243,7 +243,7 @@ static int test_zswapin(const char *root) goto out; } =20 - if (zswpin < MB(24) / PAGE_SIZE) { + if (zswpin < MB(24) / sysconf(_SC_PAGESIZE)) { ksft_print_msg("at least 24MB should be brought back from zswap\n"); goto out; } --=20 2.53.0