summaryrefslogtreecommitdiff
path: root/tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorGuopeng Zhang <zhangguopeng@kylinos.cn>2025-12-03 19:56:29 +0800
committerTejun Heo <tj@kernel.org>2025-12-08 08:44:54 -1000
commit311ead1be05d2348e89f873337c8375e856e1abb (patch)
tree7bd5f66f4ef12c999dac7355591cbd7565d00278 /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git
parent3309b63a2281efb72df7621d60cc1246b6286ad3 (diff)
selftests: cgroup: Add cg_read_key_long_poll() to poll a cgroup key with retries
Introduce a new helper function `cg_read_key_long_poll()` in cgroup_util.h. This function polls the specified key in a cgroup file until it matches the expected value or the retry limit is reached, with configurable wait intervals between retries. This helper is particularly useful for handling asynchronously updated cgroup statistics (e.g., memory.stat), where immediate reads may observe stale values, especially on busy systems. It allows tests and other utilities to handle such cases more flexibly. Signed-off-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Suggested-by: Michal Koutný <mkoutny@suse.com> Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev> Acked-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions