public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/setrlimit06: lower RLIMIT_CPU parameters
Date: Tue, 11 Feb 2020 05:52:06 -0500 (EST)	[thread overview]
Message-ID: <1734212650.7000036.1581418326024.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAEemH2f90MPBV_w2+gw331cg0Fiu-=aqgp3M1BHhBCXcFUbyyg@mail.gmail.com>



----- Original Message -----
> On Mon, Feb 10, 2020 at 8:47 PM Jan Stancek <jstancek@redhat.com> wrote:
> 
> > Lower the parameters so that test completes faster where possible.
> >
> > This also increases alarm timer slightly, which in combination with
> > lower RLIMIT_CPU aims to avoid false positives in environments with
> > high steal time, where it can take multiple of wall clock seconds
> > to spend single second on a cpu.
> >
> 
> This patch could reduce the test failure possibility, but I'm afraid it
> can't fix the problem radically, because with `stress -c 20' to overload an
> s390x system(2cpus) in the background then setrlimit06(patched) still
> easily gets failed:
>     setrlimit06.c:98: FAIL: Got only SIGXCPU after reaching both limit
> 
> Another way I can think of is to raise the priority before its running, not
> sure if that will disturb the original test but from my test, it always
> gets a pass even with too much overload.

Is this in addition to my patch? Because on its own I don't see how this
will help when load is coming from different guests.

> 
> --- a/testcases/kernel/syscalls/setrlimit/setrlimit06.c
> +++ b/testcases/kernel/syscalls/setrlimit/setrlimit06.c
> @@ -25,6 +25,7 @@
>  #include <sys/wait.h>
>  #include <stdlib.h>
>  #include <sys/mman.h>
> +#include <sys/resource.h>
> 
>  #include "tst_test.h"
> 
> @@ -37,6 +38,8 @@ static void sighandler(int sig)
> 
>  static void setup(void)
>  {
> +       setpriority(PRIO_PROCESS, 0, -20);
> +
>         SAFE_SIGNAL(SIGXCPU, sighandler);
> 
>         end = SAFE_MMAP(NULL, sizeof(int), PROT_READ | PROT_WRITE,
> @@ -110,6 +113,7 @@ static void verify_setrlimit(void)
>  }
> 
>  static struct tst_test test = {
> +       .needs_root = 1,
>         .test_all = verify_setrlimit,
>         .setup = setup,
>         .cleanup = cleanup,
> 
> --
> Regards,
> Li Wang
> 


  reply	other threads:[~2020-02-11 10:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 12:47 [LTP] [PATCH] syscalls/setrlimit06: lower RLIMIT_CPU parameters Jan Stancek
2020-02-10 13:50 ` Xiao Yang
2020-02-11  8:49 ` Li Wang
2020-02-11 10:52   ` Jan Stancek [this message]
2020-02-11 11:53     ` Li Wang
2020-02-11 12:10       ` Jan Stancek
2020-02-11 12:18         ` Li Wang
2020-02-11 12:39           ` Jan Stancek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1734212650.7000036.1581418326024.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox