ltp.lists.linux.it archive mirror
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] mem: make use of save_restore to simplify code
Date: Fri, 23 Jun 2023 09:34:25 +0800	[thread overview]
Message-ID: <CAEemH2f5i5NhuCT3DFUNEK3h4giedMg0pQGa5vSga6GB8eiCaA@mail.gmail.com> (raw)
In-Reply-To: <20230622100559.GC482307@pevik>

On Thu, Jun 22, 2023 at 6:06 PM Petr Vorel <pvorel@suse.cz> wrote:

> Hi Li,
>
> ...
> > > Also third parameter of set_sys_tune() (check) is 0.
>
>
> > The checks inside set_sys_tuen() can NOT guarantee the
> > "overcommit_memory" knob is exist or not, it only examines if the
> > value was being set correctly, because set_sys_tune has first use
> > SAFE_FILE_PRINTF which will TBROK directly when the knob non-exist.
>
> Ah, thanks for correcting me.
>
>
> > > > -     if (old_overcommit_ratio != -1)
> > > > -             set_sys_tune("overcommit_ratio", old_overcommit_ratio,
> 0);
> > > > -}
> > > > -
> > > >  static void overcommit_memory_test(void)
> > > >  {
>
> > > > @@ -269,6 +255,10 @@ static struct tst_test test = {
> > > >               {}
> > > >       },
> > > >       .setup = setup,
> > > > -     .cleanup = cleanup,
> > > >       .test_all = overcommit_memory_test,
> > > > +     .save_restore = (const struct tst_path_val[]) {
> > > > +             {"/proc/sys/vm/overcommit_memory", NULL, TST_SR_TBROK},
> > > > +             {"/proc/sys/vm/overcommit_ratio", NULL, TST_SR_TBROK},
> > > => shouldn't be here TST_SR_TCONF instead of TST_SR_TBROK?
>
>
> > It doesn't matter, I indeed consider this before, but after looking
> > through the rest mm tests they all use the function get|set_sys_tune()
> > which checks the knob mandatorily and run smoothly for past
> > many years and nobody ever complains about that.
>
> +1
>
> > So I think it's safe to convert this one using TBROK too, it essentially
> > has no difference from other oom-tests. 'overcommit_ratio' and
> > 'overcommit_memory' are quite basic on Linux distribution.
>
> +1
> => go ahead and merge.
>


Both pushed, thank you!


-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2023-06-23  1:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 10:51 [LTP] [PATCH] mem: make use of save_restore to simplify code Li Wang
2023-06-21  8:35 ` Petr Vorel
2023-06-22  8:53   ` Li Wang
2023-06-22 10:05     ` Petr Vorel
2023-06-23  1:34       ` Li Wang [this message]

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=CAEemH2f5i5NhuCT3DFUNEK3h4giedMg0pQGa5vSga6GB8eiCaA@mail.gmail.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).