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
This commit is contained in:
Rahat Mahmood
2022-11-15 13:51:45 -08:00
committed by gVisor bot
parent 7c3ff55fab
commit 58c71d54fc
+5
View File
@@ -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));