diff mbox series

nss_files: Tune down tst-nss-files-hosts-getent resource usage

Message ID 20230607134412.245650-1-adhemerval.zanella@linaro.org
State New
Headers show
Series nss_files: Tune down tst-nss-files-hosts-getent resource usage | expand

Commit Message

Adhemerval Zanella Netto June 7, 2023, 1:44 p.m. UTC
The tests creates about 4860 subprocesses, which might stress the
system and generate a false-negative due timeout depending of the
system load.  For instance, on Ryzen 5900X on 5.19.0-43-generic
without any system load

$ time (nss/tst-nss-files-hosts-getent --direct)

real    0m1,501s
user    0m1,226s
sys     0m0,275s

However, if system does have some load:

$ stress-ng -c $(nproc) -i 1 -m 1 --vm-bytes 128M -t 120s &
$ time (nss/tst-nss-files-hosts-getent --direct)

real    1m6,592s
user    0m2,515s
sys     0m0,389s

The buffers size  coverage also stresses similar code paths, so
lower the maximum buffer size checked.

Checked on x86_64-linux-gnu.
---
 nss/tst-nss-files-hosts-getent.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Adhemerval Zanella Netto Aug. 2, 2023, 4:31 p.m. UTC | #1
Ping.

On 07/06/23 10:44, Adhemerval Zanella wrote:
> The tests creates about 4860 subprocesses, which might stress the
> system and generate a false-negative due timeout depending of the
> system load.  For instance, on Ryzen 5900X on 5.19.0-43-generic
> without any system load
> 
> $ time (nss/tst-nss-files-hosts-getent --direct)
> 
> real    0m1,501s
> user    0m1,226s
> sys     0m0,275s
> 
> However, if system does have some load:
> 
> $ stress-ng -c $(nproc) -i 1 -m 1 --vm-bytes 128M -t 120s &
> $ time (nss/tst-nss-files-hosts-getent --direct)
> 
> real    1m6,592s
> user    0m2,515s
> sys     0m0,389s
> 
> The buffers size  coverage also stresses similar code paths, so
> lower the maximum buffer size checked.
> 
> Checked on x86_64-linux-gnu.
> ---
>  nss/tst-nss-files-hosts-getent.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/nss/tst-nss-files-hosts-getent.c b/nss/tst-nss-files-hosts-getent.c
> index e52b845bb7..556347c373 100644
> --- a/nss/tst-nss-files-hosts-getent.c
> +++ b/nss/tst-nss-files-hosts-getent.c
> @@ -251,8 +251,8 @@ do_test (void)
>      FAIL_EXIT1 ("could not load " LIBNSS_DNS_SO ": %s", dlerror ());
>  
>    /* Each name takes about 20 bytes, so this covers a wide range of
> -     buffer sizes, from less than 1000 bytes to about 18000 bytes.  */
> -  for (name_count = 40; name_count <= 850; ++name_count)
> +     buffer sizes, from less than 1000 bytes to about 5000 bytes.  */
> +  for (name_count = 40; name_count <= 250; ++name_count)
>      {
>        write_hosts ();
>
diff mbox series

Patch

diff --git a/nss/tst-nss-files-hosts-getent.c b/nss/tst-nss-files-hosts-getent.c
index e52b845bb7..556347c373 100644
--- a/nss/tst-nss-files-hosts-getent.c
+++ b/nss/tst-nss-files-hosts-getent.c
@@ -251,8 +251,8 @@  do_test (void)
     FAIL_EXIT1 ("could not load " LIBNSS_DNS_SO ": %s", dlerror ());
 
   /* Each name takes about 20 bytes, so this covers a wide range of
-     buffer sizes, from less than 1000 bytes to about 18000 bytes.  */
-  for (name_count = 40; name_count <= 850; ++name_count)
+     buffer sizes, from less than 1000 bytes to about 5000 bytes.  */
+  for (name_count = 40; name_count <= 250; ++name_count)
     {
       write_hosts ();