From: ranxiaokai627@163.com
To: mkoutny@suse.com
Cc: akpm@linux-foundation.org, cgroups@vger.kernel.org,
hannes@cmpxchg.org, hughd@google.com, kuba@kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-mm@kvack.org, mhocko@kernel.org, muchun.song@linux.dev,
ran.xiaokai@zte.com.cn, ranxiaokai627@163.com,
roman.gushchin@linux.dev, shakeel.butt@linux.dev,
shuah@kernel.org, tj@kernel.org
Subject: Re: [PATCH 1/2] kselftests: cgroup: update kmem test tolerance for multi-memcg stock
Date: Wed, 15 Apr 2026 11:03:56 +0000 [thread overview]
Message-ID: <20260415110356.3546-1-ranxiaokai627@163.com> (raw)
In-Reply-To: <vjhou23d62pvtdqsan2nrlldkwf27qchpfmzf4yoetqn2gdhbj@cfiuqzzotbxf>
>Hello Xiaokai.
>
>On Tue, Apr 14, 2026 at 11:05:23AM +0000, ranxiaokai627@163.com wrote:
>> Fixes: f735eebe55f8 ("memcg: multi-memcg percpu charge cache")
>
>An interesting catch.
>
>> -#define MAX_VMSTAT_ERROR (4096 * 64 * get_nprocs())
>> +#define NR_MEMCG_STOCK 7
>> +#define MAX_VMSTAT_ERROR (4096 * 64 * NR_MEMCG_STOCK * get_nprocs())
>
>When you touch this, I think this could be factored into it too:
>
>+#define MAX_VMSTAT_ERROR (sysconf(_SC_PAGESIZE) * 64 * NR_MEMCG_STOCK * get_nprocs())
Thanks for the review, yes, this will improve the test' portability
across architectures with different page sizes.
>And given how much the selftest depends in this implementation
>detail(?), I see that there are other selftests that include directly
>from the tree, I'd suggest also
>#include "../../../../include/linux/memcontrol.h"
>
>and use the constant from there (i.e. move NR_MEMCG_STOCK to there too).
>
>That should make the selftest more flexible, resilient to future changes
>and it'd document ramification of these constants too.
Agreed. Including memcontrol.h ensures the test stays in sync with
kernel changes.
>Thanks,
>Michal
next prev parent reply other threads:[~2026-04-15 11:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 11:05 [PATCH 0/2] kselftests: cgroup: fix test_kmem false failures ranxiaokai627
2026-04-14 11:05 ` [PATCH 1/2] kselftests: cgroup: update kmem test tolerance for multi-memcg stock ranxiaokai627
2026-04-15 9:53 ` Michal Koutný
2026-04-15 11:03 ` ranxiaokai627 [this message]
2026-04-14 11:05 ` [PATCH 2/2] kselftests: cgroup: account for slab memory in test_percpu_basic ranxiaokai627
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=20260415110356.3546-1-ranxiaokai627@163.com \
--to=ranxiaokai627@163.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=ran.xiaokai@zte.com.cn \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
/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