Re: [PATCH v7 4/8] selftests/cgroup: rename PAGE_SIZE to BUF_SIZE in cgroup_util

Li Wang <[email protected]>
Newsgroups dev.linux.lists.sashiko
Message-ID <[email protected]>
On Fri, Apr 24, 2026 at 05:15:56AM +0000, [email protected] 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 <[email protected]>
> 
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.