* Re: [PATCH v7 4/8] selftests/cgroup: rename PAGE_SIZE to BUF_SIZE in cgroup_util
[not found] ` <20260424051557.8AA6AC19425@smtp.kernel.org>
@ 2026-04-24 6:04 ` Li Wang
0 siblings, 0 replies; only message in thread
From: Li Wang @ 2026-04-24 6:04 UTC (permalink / raw)
To: sashiko; +Cc: mkoutny, tj, hannes
On Fri, Apr 24, 2026 at 05:15:56AM +0000, sashiko-bot@kernel.org wrote:
> Sashiko AI review found 1 potential issue(s):
> - [Low] The patch breaks the compilation of `test_zswap.c` by removing `PAGE_SIZE` without updating its usage.
> --
>
> commit f89f779468515400be3a3b17ce623322ceceeb45
> Author: Li Wang <li.wang@linux.dev>
>
> selftests/cgroup: rename PAGE_SIZE to BUF_SIZE in cgroup_util
>
> This commit renames the hardcoded PAGE_SIZE macro to BUF_SIZE to accurately
> reflect its purpose as an I/O buffer size. It also updates test_memcontrol
> to dynamically determine the system page size instead of relying on the
> hardcoded 4K value.
>
> > diff --git a/tools/testing/selftests/cgroup/lib/include/cgroup_util.h b/tools/testing/selftests/cgroup/lib/include/cgroup_util.h
> > index 567b1082974c53..febc1723d09038 100644
> > --- a/tools/testing/selftests/cgroup/lib/include/cgroup_util.h
> > +++ b/tools/testing/selftests/cgroup/lib/include/cgroup_util.h
> > @@ -2,8 +2,8 @@
> > #include <stdbool.h>
> > #include <stdlib.h>
> >
> > -#ifndef PAGE_SIZE
> > -#define PAGE_SIZE 4096
> > +#ifndef BUF_SIZE
> > +#define BUF_SIZE 4096
>
> Does renaming this macro cause test_zswap.c to fail to compile with an
> undeclared identifier error?
>
> It appears test_zswap.c still relies on PAGE_SIZE being defined by this
> header for loops iterating over memory, such as:
>
> for (size_t i = 0; i < size; i += PAGE_SIZE)
This newline was introduced by a new commit:
4e89004ee ("selftests/cgroup: add test for zswap incompressible pages")
After rebase, I have resolved it in patch 5/8.
--
Regards,
Li Wang
^ permalink raw reply [flat|nested] only message in thread