Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getrusage03: Forcing context switches to update resource usage
Our CI sporadically complains that this test grandchild's MAXRSS did not reach the expected 300MB size. 12 getrusage03.c:86: TFAIL: child.children = 258048, expected 307200 As the ru_maxrss value is generally updated at certain intervals or under specific conditions, such as page faults or context switches. There may be delay between the completion of memset() and the update of ru_maxrss. To address this issue, we create a function to force context switches by calling sched_yield() multiple times. This approach helps to ensure that the system has the opportunity to update the ru_maxrss value more promptly. Reproted-by: Scott Weaver <[email protected]> Signed-off-by: Li Wang <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
- Loading branch information