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 438D13890F5 for ; Thu, 12 Mar 2026 04:06:59 +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=1773288421; cv=none; b=RCLdsmUpm5ez/LPQZkz23utH5EGv8qtJ2hweHKLnWB+/6rBWEQut7VZV+mAnY3WOAvQ7PoDz+7CF4cTfyiM63S3wC7i+MbmdcgUxmFr53Kkh6DhdUUSG9YFE9KHneXThpkGobFAuF2mV52GXzL0HmS7o5jZft9ee4iMHmwtxGW4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773288421; c=relaxed/simple; bh=cktkCWFbcD8rCmgFzJe+mUK/69TcqZt+KKnkZSrSrqY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LHsp7bY0JpYb+U8kgdGHlSS9YtiFXTbeMaIv2oqjE8Qtu8gbW5qaEheaNEKO4tR11UvtMb8WjZ/mbhghzGvUOwuYvFTc5qjdJUHsTwe1CMmNmiU4HcToOKKNWQcq92XYhFRhWTkFrJzXiu78ZZYXdXEHsix8sGqcv0B5igjDnTg= 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=Lk8lX1Ui; 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="Lk8lX1Ui" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773288418; 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=1oqyGkpiXQH6MfLqjVNkFfBzl0bb79Z7LYQCcOdDcbA=; b=Lk8lX1UizybiDw2WLTGfvL8djsvyLEGA7sRedrnsZeKq5ieAvjPfhi6NdwnRj4NzjV56t8 65HgWR9mc4Lh7V6+qaLCU0MZND23fi337i9DSLA+3tnn3MYklAskqAkaYvXlrTZ9SuuOdt nIBdWMr15Cmkvbxjkoo6gMvQDCuBY3s= 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-523-fYOGFEniNoKoO_H95PMI0A-1; Thu, 12 Mar 2026 00:06:52 -0400 X-MC-Unique: fYOGFEniNoKoO_H95PMI0A-1 X-Mimecast-MFC-AGG-ID: fYOGFEniNoKoO_H95PMI0A_1773288410 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 AD60E180044D; Thu, 12 Mar 2026 04:06:50 +0000 (UTC) Received: from fedora-laptop-x1.redhat.com (unknown [10.72.112.57]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C1EDA19560A6; Thu, 12 Mar 2026 04:06:44 +0000 (UTC) From: Li Wang To: mkoutny@suse.com, yosryahmed@google.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Yosry Ahmed , Johannes Weiner , Michal Hocko , Muchun Song , Nhat Pham , Tejun Heo , Roman Gushchin , Shakeel Butt Subject: [PATCH v2 3/7] selftests/cgroup: use runtime page size for zswpin check Date: Thu, 12 Mar 2026 12:06:23 +0800 Message-ID: <20260312040627.55257-3-liwang@redhat.com> In-Reply-To: <20260312040627.55257-1-liwang@redhat.com> References: <20260312040627.55257-1-liwang@redhat.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 Reviewed-by: Yosry Ahmed Cc: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutný Cc: Muchun Song Cc: Nhat Pham Cc: Tejun Heo Cc: Roman Gushchin Cc: Shakeel Butt --- 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/selftests/cgroup/test_zswap.c index 8bf5fc34bb23..032c36658a15 100644 --- a/tools/testing/selftests/cgroup/test_zswap.c +++ b/tools/testing/selftests/cgroup/test_zswap.c @@ -235,7 +235,7 @@ static int test_zswapin(const char *root) goto out; } - 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; } -- 2.53.0