[LTP] [PATCH] getrusage03: Forcing context switches to update resource usage

Cyril Hrubis chrubis@suse.cz
Tue Sep 17 13:16:36 CEST 2024


Hi!
> 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 <scweaver@redhat.com>
> Signed-off-by: Li Wang <liwang@redhat.com>

This looks forgotten but should probably go in before the release...

Anyways:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list