From 58c71d54fc063439fe6fdf1125d3b4a46cd31041 Mon Sep 17 00:00:00 2001 From: Rahat Mahmood Date: Tue, 15 Nov 2022 13:48:33 -0800 Subject: [PATCH] Disable S/R while rapidly polling control files in cgroups tests. This resulted in too many S/Rs and prevents tasks from being scheduled and accumulating CPU time. PiperOrigin-RevId: 488748888 --- test/util/cgroup_util.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/util/cgroup_util.cc b/test/util/cgroup_util.cc index dca02c6ce..ca9bc4d29 100644 --- a/test/util/cgroup_util.cc +++ b/test/util/cgroup_util.cc @@ -102,6 +102,11 @@ PosixError Cgroup::PollControlFileForChangeAfter( body(); + // The loop below iterates quickly and results in too many save-restore + // cycles. This can prevent tasks from being scheduled and incurring the + // resource usage this function is often waiting for, resulting in timeouts. + const DisableSave ds; + while (true) { ASSIGN_OR_RETURN_ERRNO(const int64_t current_value, ReadIntegerControlFile(name));