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] mem/oom: do cleanup work for oom0{3,4,5}
Date: Fri, 19 Feb 2016 07:18:27 -0500 (EST)	[thread overview]
Message-ID: <731626733.22683827.1455884307705.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAEemH2fnOp_FuXAbq9JPw6wtabCUQY5cxeCk0eGT9e041kx82g@mail.gmail.com>





----- Original Message -----
> From: "Li Wang" <liwang@redhat.com>
> To: ltp@lists.linux.it
> Sent: Wednesday, 17 February, 2016 2:51:09 AM
> Subject: Re: [LTP] [PATCH] mem/oom: do cleanup work for oom0{3,4,5}
> 
> sorry, ping~
> 
> On Fri, Jan 29, 2016 at 9:36 PM, Li Wang < liwang@redhat.com > wrote:
> 
> 
> oom03 should not test on aarch64 system which does not support NUMA, so I add
> the function to make sure it could be skiped.
> -----
> # ./oom03
> oom03 0 TINFO : set overcommit_memory to 1
> ...
> oom03 0 TINFO : expected victim is 29154.
> oom03 6 TPASS : victim signalled: (9) SIGKILL
> oom03 7 TCONF : numa_helper.c:86: syscall(236) __NR_get_mempolicy not
> supported on your arch
> oom03 8 TCONF : numa_helper.c:86: Remaining cases not appropriate for
> configuration
> 
> oom0{4,5} get fails on aarch64 system if run it in continuous twice(the
> first time skiped with TCONF, then the second time it will be failed).
> -----
> # ./oom05
> oom05 0 TINFO : set overcommit_memory to 1
> oom05 1 TCONF : numa_helper.c:86: syscall(236) __NR_get_mempolicy not
> supported on your arch
> oom05 2 TCONF : numa_helper.c:86: Remaining cases not appropriate for
> configuration
> 
> # ./oom05
> oom05 0 TINFO : set overcommit_memory to 1
> oom05 1 TBROK : mem.c:997: mkdir /dev/cgroup: errno=EEXIST(17): File exists
> oom05 2 TBROK : mem.c:997: Remaining cases broken
> oom05 0 TINFO : set overcommit_memory to 1
> 
> the reason is that it doesn't pass the cleanup to the tst_brkm() there.
> 
> Signed-off-by: Li Wang < liwang@redhat.com >

Li,

I pushed the part for oom04 and oom05.

As for oom03 changes, these should go in separately, because
it's not about cleanup.

Can you explain why first testoom() call on line 65 can't run on
aarch64? There doesn't seem to be anything NUMA specific.

It seems to me your problem is that is_numa() causes TCONF, which
it shouldn't. So, I'm thinking we should fix that:

diff --git a/testcases/kernel/lib/numa_helper.c b/testcases/kernel/lib/numa_helper.c
index 0074180991ec..91214fcd85d9 100644
--- a/testcases/kernel/lib/numa_helper.c
+++ b/testcases/kernel/lib/numa_helper.c
@@ -76,14 +76,22 @@ static int filter_nodemask_mem(nodemask_t * nodemask, unsigned long max_node)
 {
 #if MPOL_F_MEMS_ALLOWED
        unsigned long nodemask_size = max_node / 8;
+       int ret;
+
        memset(nodemask, 0, nodemask_size);
        /*
         * avoid numa_get_mems_allowed(), because of bug in getpol()
         * utility function in older versions:
         * http://www.spinics.net/lists/linux-numa/msg00849.html
         */
-       if (ltp_syscall(__NR_get_mempolicy, NULL, nodemask->n,
-                   max_node, 0, MPOL_F_MEMS_ALLOWED) < 0)
+       ret = syscall(__NR_get_mempolicy, NULL, nodemask->n,
+                   max_node, 0, MPOL_F_MEMS_ALLOWED);
+       /*
+        * If we don't have __NR_get_mempolicy assume we can use all
+        * present nodes. It is likely this is a system, that doesn't
+        * support NUMA and there's just 1 node.
+        */
+       if (ret < 0 && errno != ENOSYS)
                return -2;
 #else
        int i;

I'll look into trying this patch on aarch64 with oom03.

Regards,
Jan

      reply	other threads:[~2016-02-19 12:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 13:36 [LTP] [PATCH] mem/oom: do cleanup work for oom0{3,4,5} Li Wang
2016-02-17  1:51 ` Li Wang
2016-02-19 12:18   ` Jan Stancek [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=731626733.22683827.1455884307705.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