Hi Waiman, I currently have another patch in hand that is functionally identical to patch 3/7 here (requested by Sashiko). May I go ahead and merge it directly into my patch series, while retaining your authorship attribution? Otherwise, our respective patches will conflict when merged into the mm-tree. See: https://sashiko.dev/#/patchset/20260322061038.156146-1-liwang@redhat.com On Sat, Mar 21, 2026 at 4:43 AM Waiman Long wrote: > The current test_memcontrol test fault in memory by write a value > to the start of a page based on the default value of 4k page size. > Micro-optimize it by using the actual system page size to do the > iteration. > > Reviewed-by: Li Wang > Signed-off-by: Waiman Long > --- > tools/testing/selftests/cgroup/test_memcontrol.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c > b/tools/testing/selftests/cgroup/test_memcontrol.c > index a25eb097b31c..babbfad10aaf 100644 > --- a/tools/testing/selftests/cgroup/test_memcontrol.c > +++ b/tools/testing/selftests/cgroup/test_memcontrol.c > @@ -25,6 +25,7 @@ > > static bool has_localevents; > static bool has_recursiveprot; > +static int page_size; > > int get_temp_fd(void) > { > @@ -60,7 +61,7 @@ int alloc_anon(const char *cgroup, void *arg) > char *buf, *ptr; > > buf = malloc(size); > - for (ptr = buf; ptr < buf + size; ptr += PAGE_SIZE) > + for (ptr = buf; ptr < buf + size; ptr += page_size) > *ptr = 0; > > free(buf); > @@ -183,7 +184,7 @@ static int alloc_anon_50M_check(const char *cgroup, > void *arg) > return -1; > } > > - for (ptr = buf; ptr < buf + size; ptr += PAGE_SIZE) > + for (ptr = buf; ptr < buf + size; ptr += page_size) > *ptr = 0; > > current = cg_read_long(cgroup, "memory.current"); > @@ -413,7 +414,7 @@ static int alloc_anon_noexit(const char *cgroup, void > *arg) > return -1; > } > > - for (ptr = buf; ptr < buf + size; ptr += PAGE_SIZE) > + for (ptr = buf; ptr < buf + size; ptr += page_size) > *ptr = 0; > > while (getppid() == ppid) > @@ -999,7 +1000,7 @@ static int alloc_anon_50M_check_swap(const char > *cgroup, void *arg) > return -1; > } > > - for (ptr = buf; ptr < buf + size; ptr += PAGE_SIZE) > + for (ptr = buf; ptr < buf + size; ptr += page_size) > *ptr = 0; > > mem_current = cg_read_long(cgroup, "memory.current"); > @@ -1679,6 +1680,10 @@ int main(int argc, char **argv) > char root[PATH_MAX]; > int i, proc_status; > > + page_size = sysconf(_SC_PAGE_SIZE); > + if (page_size <= 0) > + page_size = PAGE_SIZE; > + > ksft_print_header(); > ksft_set_plan(ARRAY_SIZE(tests)); > if (cg_find_unified_root(root, sizeof(root), NULL)) > -- > 2.53.0 > > -- Regards, Li Wang