From: Sayali Patil <sayalip@linux.ibm.com>
To: Li Wang <li.wang@linux.dev>,
akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org,
roman.gushchin@linux.dev, shakeel.butt@linux.dev,
muchun.song@linux.dev, tj@kernel.org, mkoutny@suse.com,
shuah@kernel.org
Cc: cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Waiman Long <longman@redhat.com>,
Christoph Lameter <cl@linux.com>,
Shakeel Butt <shakeelb@google.com>,
Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH v2 1/2] selftests/cgroup: Fix hardcoded page size in test_percpu_basic
Date: Wed, 6 May 2026 17:40:01 +0530 [thread overview]
Message-ID: <5308bbfc-286b-45a9-b527-c282ce95a028@linux.ibm.com> (raw)
In-Reply-To: <20260501022058.18024-2-li.wang@linux.dev>
On 01/05/26 07:50, Li Wang wrote:
> MAX_VMSTAT_ERROR uses a hardcoded page size of 4096, which assumes
> 4K pages. This causes test_percpu_basic to fail on systems where
> the kernel is configured with a larger page size, such as aarch64
> systems using 16K or 64K pages, where the maximum permissible
> discrepancy between memory.current and percpu charges is
> proportionally larger.
>
> Replace the hardcoded 4096 with sysconf(_SC_PAGESIZE) to correctly
> derive the page size at runtime regardless of the underlying
> architecture or kernel configuration.
>
> Signed-off-by: Li Wang <li.wang@linux.dev>
> Cc: Waiman Long <longman@redhat.com>
> Cc: Christoph Lameter <cl@linux.com>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Shakeel Butt <shakeelb@google.com>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Acked-by: Waiman Long <longman@redhat.com>
> ---
> tools/testing/selftests/cgroup/test_kmem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/cgroup/test_kmem.c b/tools/testing/selftests/cgroup/test_kmem.c
> index eeabd34bf08..249d7911306 100644
> --- a/tools/testing/selftests/cgroup/test_kmem.c
> +++ b/tools/testing/selftests/cgroup/test_kmem.c
> @@ -24,7 +24,7 @@
> * the maximum discrepancy between charge and vmstat entries is number
> * of cpus multiplied by 64 pages.
> */
> -#define MAX_VMSTAT_ERROR (4096 * 64 * get_nprocs())
> +#define MAX_VMSTAT_ERROR (sysconf(_SC_PAGESIZE) * 64 * get_nprocs())
>
> #define KMEM_DEAD_WAIT_RETRIES 80
>
Reviewed-by: Sayali Patil <sayalip@linux.ibm.com>
Thanks,
Sayali
next prev parent reply other threads:[~2026-05-06 12:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-01 2:20 [PATCH v2 0/2] selftests/cgroup: Fix false positive failures in test_percpu_basic Li Wang
2026-05-01 2:20 ` [PATCH v2 1/2] selftests/cgroup: Fix hardcoded page size " Li Wang
2026-05-06 12:10 ` Sayali Patil [this message]
2026-05-01 2:20 ` [PATCH v2 2/2] selftests/cgroup: include slab in test_percpu_basic memory check Li Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5308bbfc-286b-45a9-b527-c282ce95a028@linux.ibm.com \
--to=sayalip@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=cl@linux.com \
--cc=hannes@cmpxchg.org \
--cc=li.wang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=longman@redhat.com \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=shakeelb@google.com \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox