On Wed, Dec 03, 2025 at 07:59:46PM +0800, Guopeng Zhang zhangguopeng@kylinos.cn wrote:
In v5 I tried to follow that direction by introducing a generic helper function:
cg_read_key_long_poll()in cgroup_util.[ch]. This helper encapsulates the "poll with retries" logic and returns the final value, while leaving the actual assertion to the callers. Tests like test_memcg_sock() and test_kmem_dead_cgroups() then decide what condition they want to check (e.g. == 0, > 0, etc.), which seemed a bit more flexible and reusable for other cgroup stats.
Please let me know if you think this direction makes sense or if you have any further suggestions.
Thanks, I think this is ideal for the current tests. (I skimmed through the v5 and I have no more remarks.)
Michal