Re: [PATCH bpf-next] selftests/bpf: Skip memcg_proactive_reclaim when data lands in shmem

From: Kurt Lin

Date: Mon Nov 16 2026 - 12:15:26 EST


Hi Hui,

Thanks for the review.

On 2026/11/16 11:04, Hui Zhu wrote:
> Would it make sense to turn the silent "return false" into an explicit
> assertion, e.g.:
>
> if (!ASSERT_OK(read_cgroup_file(CG_PATH, "memory.stat", buf,
> sizeof(buf)), "read memory.stat"))
> return false;

Agreed, a read or parse failure will fail the test in v2.

> Small nit: a one-line comment on the threshold might help future
> readers, something like "all-or-nothing: the data file is either fully
> shmem (stacked tmpfs) or not shmem at all (disk-backed), so half of
> FILE_SIZE is a safe midpoint". Also, printing the measured shmem value
> in the SKIP message could be handy when debugging odd environments.

Will do both.

v2 will also address two points sashiko raised: memory.stat is not
force-flushed, so right after the write it can still read 0 on machines
with many CPUs, and a shmem-backed /tmp should fall back to "." instead
of skipping. I plan to poll memory.stat until the write shows up and to
try each candidate directory in a cgroup of its own.

Thanks,
Kurt