public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP]  Regarding memcg control  testcase (mem_process.c)
@ 2015-07-24  4:07 Manjeet Pawar
  2015-07-26 11:28 ` Jan Stancek
  0 siblings, 1 reply; 7+ messages in thread
From: Manjeet Pawar @ 2015-07-24  4:07 UTC (permalink / raw)
  To: ltp-list; +Cc: ajeet.y@samsung.com, pankaj.m

Hi,

I am trying to run memcg control testcase using script memcg_control_test.sh. This script calls a memory hog process 'mem_process'. 
The condition for this testcase to pass is 'when the memory hog process is killed on crossing boundary'. please check the below function.

<taken from memcg_control_test.sh>
-----------------------------
# Check if the test process is killed on crossing boundary
test_proc_kill()
{
    ( cd $TMP && mem_process -m $PROC_MEM & )
    sleep 1
    echo $! > tasks

    #Instruct the test process to start acquiring memory
    echo m > $STATUS_PIPE 
    sleep 5

    #Check if killed
    ps -p $! > /dev/null 2> /dev/null    ----> at this point the process 'mem_process' must have terminated so that last return value ($?) can be non-zero.
    if [ $? -eq 0 ]; then
        echo m > $STATUS_PIPE
        echo x > $STATUS_PIPE
    else
        : $((KILLED_CNT += 1))
    fi
}
-------------------------
In my case: 'mem_process' does not terminate until we pass 'x' to it, but the expected behaviour according to testcase  that the memory hog process 
must be killed on crossing bounday. 
Inputs taken by testcase are : "./memcg_control_test.sh 4096 4096 8192"
If I change the inputs from 8192 to other (1024,10MB,100MB etc) . In all situation memory hog process does not terminate.
So what is the ideal condition for this process to terminate to make whole testcase pass. ?

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] Regarding memcg control  testcase (mem_process.c)
  2015-07-24  4:07 Manjeet Pawar
@ 2015-07-26 11:28 ` Jan Stancek
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Stancek @ 2015-07-26 11:28 UTC (permalink / raw)
  To: manjeet p; +Cc: ajeet y, ltp-list, pankaj m





----- Original Message -----
> From: "Manjeet Pawar" <manjeet.p@samsung.com>
> To: ltp-list@lists.sourceforge.net
> Cc: "ajeet y" <ajeet.y@samsung.com>, "pankaj m" <pankaj.m@samsung.com>
> Sent: Friday, 24 July, 2015 6:07:45 AM
> Subject: [LTP]  Regarding memcg control  testcase (mem_process.c)
> 
> Hi,
> 
> I am trying to run memcg control testcase using script memcg_control_test.sh.
> This script calls a memory hog process 'mem_process'.
> The condition for this testcase to pass is 'when the memory hog process is
> killed on crossing boundary'. please check the below function.
> 
> <taken from memcg_control_test.sh>
> -----------------------------
> # Check if the test process is killed on crossing boundary
> test_proc_kill()
> {
>     ( cd $TMP && mem_process -m $PROC_MEM & )
>     sleep 1
>     echo $! > tasks

mem_process is getting started via subshell, so I'd assume $! in parent is bogus.
Can you try this instead:

        pushd $TMP || return
        mem_process -m $PROC_MEM &
        local pid=$!
        popd

        sleep 1
        echo $pid > tasks


> 
>     #Instruct the test process to start acquiring memory
>     echo m > $STATUS_PIPE
>     sleep 5
> 
>     #Check if killed
>     ps -p $! > /dev/null 2> /dev/null    ----> at this point the process
>     'mem_process' must have terminated so that last return value ($?) can be
>     non-zero.
>     if [ $? -eq 0 ]; then
>         echo m > $STATUS_PIPE
>         echo x > $STATUS_PIPE
>     else
>         : $((KILLED_CNT += 1))
>     fi
> }
> -------------------------
> In my case: 'mem_process' does not terminate until we pass 'x' to it, but the
> expected behaviour according to testcase  that the memory hog process
> must be killed on crossing bounday.
> Inputs taken by testcase are : "./memcg_control_test.sh 4096 4096 8192"
> If I change the inputs from 8192 to other (1024,10MB,100MB etc) . In all
> situation memory hog process does not terminate.
> So what is the ideal condition for this process to terminate to make whole
> testcase pass. ?

mem_process getting killed by OOM seems like expected outcome:

memcg_control    0  TINFO  :  Test #1: Checking if the memory usage limit imposed by the topmost group is enforced
./memcg_control_test.sh: line 56:  2795 Killed                  mem_process -m $PROC_MEM  (wd: /tmp)
memcg_control    1  TPASS  :  Test #1: passed
memcg_control    1  TPASS  :  memcg_control: passed

If it still doesn't get killed, I'd recommend checking "memory.usage_in_bytes".

Regards,
Jan


> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] Regarding memcg control  testcase (mem_process.c)
@ 2015-07-27  8:12 Manjeet Pawar
  2015-07-27  8:32 ` Jan Stancek
  0 siblings, 1 reply; 7+ messages in thread
From: Manjeet Pawar @ 2015-07-27  8:12 UTC (permalink / raw)
  To: Jan Stancek; +Cc: AJEET YADAV, ltp-list@lists.sourceforge.net, PANKAJ MISHRA

Hello Mr Jan,
Thanks for your reply,
With actual testscript I checked my "$!" , it is printing correct pid.
Also changes which you suggest, I tried with those changes , it is showing me either "mmap failed:ffffffff" sometimes or "a successful mmap call". 
In my case "memory.usage_in_bytes" is 4096. 
Testcase is run as "./memcg_control_test.sh 4096 4096 8192". 
I am not getting this "mem_process getting killed by OOM seems like expected outcome:" 
May i know which kernel verison you are using.? Now I am doubtful on my kernel.

Regards
Manjeet

------- Original Message -------
Sender : Jan Stancek<jstancek@redhat.com>
Date : Jul 26, 2015 20:28 (GMT+09:00)
Title : Re: [LTP] Regarding memcg control testcase (mem_process.c)


----- Original Message -----
> From: "Manjeet Pawar" 
> To: ltp-list@lists.sourceforge.net
> Cc: "ajeet y" , "pankaj m" 
> Sent: Friday, 24 July, 2015 6:07:45 AM
> Subject: [LTP]  Regarding memcg control  testcase (mem_process.c)
> 
> Hi,
> 
> I am trying to run memcg control testcase using script memcg_control_test.sh.
> This script calls a memory hog process 'mem_process'.
> The condition for this testcase to pass is 'when the memory hog process is
> killed on crossing boundary'. please check the below function.
> 
> 
> -----------------------------
> # Check if the test process is killed on crossing boundary
> test_proc_kill()
> {
>     ( cd $TMP && mem_process -m $PROC_MEM & )
>     sleep 1
>     echo $! > tasks

mem_process is getting started via subshell, so I'd assume $! in parent is bogus.
Can you try this instead:

        pushd $TMP || return
        mem_process -m $PROC_MEM &
        local pid=$!
        popd

        sleep 1
        echo $pid > tasks


> 
>     #Instruct the test process to start acquiring memory
>     echo m > $STATUS_PIPE
>     sleep 5
> 
>     #Check if killed
>     ps -p $! > /dev/null 2> /dev/null    ----> at this point the process
>     'mem_process' must have terminated so that last return value ($?) can be
>     non-zero.
>     if [ $? -eq 0 ]; then
>         echo m > $STATUS_PIPE
>         echo x > $STATUS_PIPE
>     else
>         : $((KILLED_CNT += 1))
>     fi
> }
> -------------------------
> In my case: 'mem_process' does not terminate until we pass 'x' to it, but the
> expected behaviour according to testcase  that the memory hog process
> must be killed on crossing bounday.
> Inputs taken by testcase are : "./memcg_control_test.sh 4096 4096 8192"
> If I change the inputs from 8192 to other (1024,10MB,100MB etc) . In all
> situation memory hog process does not terminate.
> So what is the ideal condition for this process to terminate to make whole
> testcase pass. ?

mem_process getting killed by OOM seems like expected outcome:

memcg_control    0  TINFO  :  Test #1: Checking if the memory usage limit imposed by the topmost group is enforced
./memcg_control_test.sh: line 56:  2795 Killed                  mem_process -m $PROC_MEM  (wd: /tmp)
memcg_control    1  TPASS  :  Test #1: passed
memcg_control    1  TPASS  :  memcg_control: passed

If it still doesn't get killed, I'd recommend checking "memory.usage_in_bytes".

Regards,
Jan


> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] Regarding memcg control  testcase (mem_process.c)
  2015-07-27  8:12 Manjeet Pawar
@ 2015-07-27  8:32 ` Jan Stancek
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Stancek @ 2015-07-27  8:32 UTC (permalink / raw)
  To: manjeet p; +Cc: AJEET YADAV, ltp-list, PANKAJ MISHRA





----- Original Message -----
> From: "Manjeet Pawar" <manjeet.p@samsung.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp-list@lists.sourceforge.net, "AJEET YADAV" <ajeet.y@samsung.com>, "PANKAJ MISHRA" <pankaj.m@samsung.com>
> Sent: Monday, 27 July, 2015 10:12:46 AM
> Subject: Re: Re: [LTP]  Regarding memcg control  testcase (mem_process.c)
> 
> Hello Mr Jan,
> Thanks for your reply,
> With actual testscript I checked my "$!" , it is printing correct pid.
> Also changes which you suggest, I tried with those changes , it is showing me
> either "mmap failed:ffffffff"

When it fails, what is the errno?

> sometimes or "a successful mmap call".

Where is this message coming from? I can't find such string in my LTP.

> In my case "memory.usage_in_bytes" is 4096.
> Testcase is run as "./memcg_control_test.sh 4096 4096 8192".
> I am not getting this "mem_process getting killed by OOM seems like expected
> outcome:"
> May i know which kernel verison you are using.? Now I am doubtful on my
> kernel.

I'm on 4.0.4.

What is your kernel/arch and LTP version?

Regards,
Jan

> 
> Regards
> Manjeet
> 
> ------- Original Message -------
> Sender : Jan Stancek<jstancek@redhat.com>
> Date : Jul 26, 2015 20:28 (GMT+09:00)
> Title : Re: [LTP] Regarding memcg control testcase (mem_process.c)
> 
> 
> ----- Original Message -----
> > From: "Manjeet Pawar"
> > To: ltp-list@lists.sourceforge.net
> > Cc: "ajeet y" , "pankaj m"
> > Sent: Friday, 24 July, 2015 6:07:45 AM
> > Subject: [LTP]  Regarding memcg control  testcase (mem_process.c)
> > 
> > Hi,
> > 
> > I am trying to run memcg control testcase using script
> > memcg_control_test.sh.
> > This script calls a memory hog process 'mem_process'.
> > The condition for this testcase to pass is 'when the memory hog process is
> > killed on crossing boundary'. please check the below function.
> > 
> > 
> > -----------------------------
> > # Check if the test process is killed on crossing boundary
> > test_proc_kill()
> > {
> >     ( cd $TMP && mem_process -m $PROC_MEM & )
> >     sleep 1
> >     echo $! > tasks
> 
> mem_process is getting started via subshell, so I'd assume $! in parent is
> bogus.
> Can you try this instead:
> 
>         pushd $TMP || return
>         mem_process -m $PROC_MEM &
>         local pid=$!
>         popd
> 
>         sleep 1
>         echo $pid > tasks
> 
> 
> > 
> >     #Instruct the test process to start acquiring memory
> >     echo m > $STATUS_PIPE
> >     sleep 5
> > 
> >     #Check if killed
> >     ps -p $! > /dev/null 2> /dev/null    ----> at this point the process
> >     'mem_process' must have terminated so that last return value ($?) can
> >     be
> >     non-zero.
> >     if [ $? -eq 0 ]; then
> >         echo m > $STATUS_PIPE
> >         echo x > $STATUS_PIPE
> >     else
> >         : $((KILLED_CNT += 1))
> >     fi
> > }
> > -------------------------
> > In my case: 'mem_process' does not terminate until we pass 'x' to it, but
> > the
> > expected behaviour according to testcase  that the memory hog process
> > must be killed on crossing bounday.
> > Inputs taken by testcase are : "./memcg_control_test.sh 4096 4096 8192"
> > If I change the inputs from 8192 to other (1024,10MB,100MB etc) . In all
> > situation memory hog process does not terminate.
> > So what is the ideal condition for this process to terminate to make whole
> > testcase pass. ?
> 
> mem_process getting killed by OOM seems like expected outcome:
> 
> memcg_control    0  TINFO  :  Test #1: Checking if the memory usage limit
> imposed by the topmost group is enforced
> ./memcg_control_test.sh: line 56:  2795 Killed                  mem_process
> -m $PROC_MEM  (wd: /tmp)
> memcg_control    1  TPASS  :  Test #1: passed
> memcg_control    1  TPASS  :  memcg_control: passed
> 
> If it still doesn't get killed, I'd recommend checking
> "memory.usage_in_bytes".
> 
> Regards,
> Jan
> 
> 
> > 
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > Ltp-list mailing list
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
> >

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] Regarding memcg control  testcase (mem_process.c)
@ 2015-07-29  3:54 Manjeet Pawar
  2015-07-29  6:48 ` Jan Stancek
  0 siblings, 1 reply; 7+ messages in thread
From: Manjeet Pawar @ 2015-07-29  3:54 UTC (permalink / raw)
  To: Jan Stancek, ltp-list@lists.sourceforge.net; +Cc: AJEET YADAV, PANKAJ MISHRA

Hello Jan,
After doing analysis, I found that When memory hog process (mem_process) tries to mmap double the memory of the cgroup limit which is 4096 . I am getting OOM in that situation and send kill signal to process (which is expected behaviour) . But it could not kill the process and
 it sets the process state to uninterrupted sleep state.

To get this OOM , i need to change oom_adj value of the process '208' from -17 to -16. If i dont do this, I dont get OOM and process always stuck at mmap and try to allocate 8192 Bytes of memory.
logs:- 
[2-74.5749] Memory cgroup out of memory: Kill process 208 (mem_process) score 147000 or sacrifice child
[2-74.5840] Killed process 208 (mem_process) total-vm:2704kB, anon-rss:80kB, file-rss:484kB
by mmap is -1237753856
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root       208 39.6  0.0   2704   564 ?        D    00:01   0:02 mem_process -m 8192  // D - means uninterrupted sleep
root       215  0.0  0.0   2412   584 ?        S    00:01   0:00 grep -r 208

I am using 3.10.84 kernel. LTP is of latest  version (ltp-full-20150420)

Regards
Manjeet

------- Original Message -------
Sender : Jan Stancek<jstancek@redhat.com>
Date : Jul 27, 2015 17:32 (GMT+09:00)
Title : Re: [LTP] Regarding memcg control testcase (mem_process.c)





----- Original Message -----
> From: "Manjeet Pawar" 
> To: "Jan Stancek" 
> Cc: ltp-list@lists.sourceforge.net, "AJEET YADAV" , "PANKAJ MISHRA" 
> Sent: Monday, 27 July, 2015 10:12:46 AM
> Subject: Re: Re: [LTP]  Regarding memcg control  testcase (mem_process.c)
> 
> Hello Mr Jan,
> Thanks for your reply,
> With actual testscript I checked my "$!" , it is printing correct pid.
> Also changes which you suggest, I tried with those changes , it is showing me
> either "mmap failed:ffffffff"

When it fails, what is the errno?

> sometimes or "a successful mmap call".

Where is this message coming from? I can't find such string in my LTP.

> In my case "memory.usage_in_bytes" is 4096.
> Testcase is run as "./memcg_control_test.sh 4096 4096 8192".
> I am not getting this "mem_process getting killed by OOM seems like expected
> outcome:"
> May i know which kernel verison you are using.? Now I am doubtful on my
> kernel.

I'm on 4.0.4.

What is your kernel/arch and LTP version?

Regards,
Jan

> 
> Regards
> Manjeet
> 
> ------- Original Message -------
> Sender : Jan Stancek
> Date : Jul 26, 2015 20:28 (GMT+09:00)
> Title : Re: [LTP] Regarding memcg control testcase (mem_process.c)
> 
> 
> ----- Original Message -----
> > From: "Manjeet Pawar"
> > To: ltp-list@lists.sourceforge.net
> > Cc: "ajeet y" , "pankaj m"
> > Sent: Friday, 24 July, 2015 6:07:45 AM
> > Subject: [LTP]  Regarding memcg control  testcase (mem_process.c)
> > 
> > Hi,
> > 
> > I am trying to run memcg control testcase using script
> > memcg_control_test.sh.
> > This script calls a memory hog process 'mem_process'.
> > The condition for this testcase to pass is 'when the memory hog process is
> > killed on crossing boundary'. please check the below function.
> > 
> > 
> > -----------------------------
> > # Check if the test process is killed on crossing boundary
> > test_proc_kill()
> > {
> >     ( cd $TMP && mem_process -m $PROC_MEM & )
> >     sleep 1
> >     echo $! > tasks
> 
> mem_process is getting started via subshell, so I'd assume $! in parent is
> bogus.
> Can you try this instead:
> 
>         pushd $TMP || return
>         mem_process -m $PROC_MEM &
>         local pid=$!
>         popd
> 
>         sleep 1
>         echo $pid > tasks
> 
> 
> > 
> >     #Instruct the test process to start acquiring memory
> >     echo m > $STATUS_PIPE
> >     sleep 5
> > 
> >     #Check if killed
> >     ps -p $! > /dev/null 2> /dev/null    ----> at this point the process
> >     'mem_process' must have terminated so that last return value ($?) can
> >     be
> >     non-zero.
> >     if [ $? -eq 0 ]; then
> >         echo m > $STATUS_PIPE
> >         echo x > $STATUS_PIPE
> >     else
> >         : $((KILLED_CNT += 1))
> >     fi
> > }
> > -------------------------
> > In my case: 'mem_process' does not terminate until we pass 'x' to it, but
> > the
> > expected behaviour according to testcase  that the memory hog process
> > must be killed on crossing bounday.
> > Inputs taken by testcase are : "./memcg_control_test.sh 4096 4096 8192"
> > If I change the inputs from 8192 to other (1024,10MB,100MB etc) . In all
> > situation memory hog process does not terminate.
> > So what is the ideal condition for this process to terminate to make whole
> > testcase pass. ?
> 
> mem_process getting killed by OOM seems like expected outcome:
> 
> memcg_control    0  TINFO  :  Test #1: Checking if the memory usage limit
> imposed by the topmost group is enforced
> ./memcg_control_test.sh: line 56:  2795 Killed                  mem_process
> -m $PROC_MEM  (wd: /tmp)
> memcg_control    1  TPASS  :  Test #1: passed
> memcg_control    1  TPASS  :  memcg_control: passed
> 
> If it still doesn't get killed, I'd recommend checking
> "memory.usage_in_bytes".
> 
> Regards,
> Jan
> 
> 
> > 
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > Ltp-list mailing list
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
> >
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] Regarding memcg control  testcase (mem_process.c)
  2015-07-29  3:54 [LTP] Regarding memcg control testcase (mem_process.c) Manjeet Pawar
@ 2015-07-29  6:48 ` Jan Stancek
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Stancek @ 2015-07-29  6:48 UTC (permalink / raw)
  To: manjeet p; +Cc: AJEET YADAV, ltp-list, PANKAJ MISHRA





----- Original Message -----
> From: "Manjeet Pawar" <manjeet.p@samsung.com>
> To: "Jan Stancek" <jstancek@redhat.com>, ltp-list@lists.sourceforge.net
> Cc: "AJEET YADAV" <ajeet.y@samsung.com>, "PANKAJ MISHRA" <pankaj.m@samsung.com>
> Sent: Wednesday, 29 July, 2015 5:54:55 AM
> Subject: Re: Re: [LTP]  Regarding memcg control  testcase (mem_process.c)
> 
> Hello Jan,
> After doing analysis, I found that When memory hog process (mem_process)
> tries to mmap double the memory of the cgroup limit which is 4096 . I am
> getting OOM in that situation and send kill signal to process (which is
> expected behaviour) . But it could not kill the process and
>  it sets the process state to uninterrupted sleep state.
> 
> To get this OOM , i need to change oom_adj value of the process '208' from
> -17 to -16. If i dont do this, I dont get OOM and process always stuck at
> mmap and try to allocate 8192 Bytes of memory.

That explains it, -17 means OOM is disabled:
#define OOM_DISABLE (-17)

> logs:-
> [2-74.5749] Memory cgroup out of memory: Kill process 208 (mem_process) score
> 147000 or sacrifice child
> [2-74.5840] Killed process 208 (mem_process) total-vm:2704kB, anon-rss:80kB,
> file-rss:484kB
> by mmap is -1237753856
> Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
> root       208 39.6  0.0   2704   564 ?        D    00:01   0:02 mem_process
> -m 8192  // D - means uninterrupted sleep
> root       215  0.0  0.0   2412   584 ?        S    00:01   0:00 grep -r 208

No idea why it's getting stuck though. I'd try with oom_adj == 0. If that makes
no difference, /proc/<pid>/stack might give some additional clues.

Do you see similar behaviour with other OOM testcases?

Regards,
Jan

> 
> I am using 3.10.84 kernel. LTP is of latest  version (ltp-full-20150420)
> 
> Regards
> Manjeet
> 
> ------- Original Message -------
> Sender : Jan Stancek<jstancek@redhat.com>
> Date : Jul 27, 2015 17:32 (GMT+09:00)
> Title : Re: [LTP] Regarding memcg control testcase (mem_process.c)
> 
> 
> 
> 

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] Regarding memcg control  testcase (mem_process.c)
@ 2015-07-29  9:10 Manjeet Pawar
  0 siblings, 0 replies; 7+ messages in thread
From: Manjeet Pawar @ 2015-07-29  9:10 UTC (permalink / raw)
  To: Jan Stancek; +Cc: AJEET YADAV, ltp-list@lists.sourceforge.net, PANKAJ MISHRA

HI Jan,
Now we have run all memcg testcases , they need mainly two things:
1) echo -16 > /proc/$pid/oom_adj
2) and a long sleep ( 30 seconds) so that after OOM , it get killed, normally it takes some time, so After increasing the sleep time, mem_process get killed.
Thanks for your support.



------- Original Message -------
Sender : Jan Stancek<jstancek@redhat.com>
Date : Jul 29, 2015 15:48 (GMT+09:00)
Title : Re: [LTP] Regarding memcg control testcase (mem_process.c)





----- Original Message -----
> From: "Manjeet Pawar" 
> To: "Jan Stancek" , ltp-list@lists.sourceforge.net
> Cc: "AJEET YADAV" , "PANKAJ MISHRA" 
> Sent: Wednesday, 29 July, 2015 5:54:55 AM
> Subject: Re: Re: [LTP]  Regarding memcg control  testcase (mem_process.c)
> 
> Hello Jan,
> After doing analysis, I found that When memory hog process (mem_process)
> tries to mmap double the memory of the cgroup limit which is 4096 . I am
> getting OOM in that situation and send kill signal to process (which is
> expected behaviour) . But it could not kill the process and
>  it sets the process state to uninterrupted sleep state.
> 
> To get this OOM , i need to change oom_adj value of the process '208' from
> -17 to -16. If i dont do this, I dont get OOM and process always stuck at
> mmap and try to allocate 8192 Bytes of memory.

That explains it, -17 means OOM is disabled:
#define OOM_DISABLE (-17)

> logs:-
> [2-74.5749] Memory cgroup out of memory: Kill process 208 (mem_process) score
> 147000 or sacrifice child
> [2-74.5840] Killed process 208 (mem_process) total-vm:2704kB, anon-rss:80kB,
> file-rss:484kB
> by mmap is -1237753856
> Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
> root       208 39.6  0.0   2704   564 ?        D    00:01   0:02 mem_process
> -m 8192  // D - means uninterrupted sleep
> root       215  0.0  0.0   2412   584 ?        S    00:01   0:00 grep -r 208

No idea why it's getting stuck though. I'd try with oom_adj == 0. If that makes
no difference, /proc//stack might give some additional clues.

Do you see similar behaviour with other OOM testcases?

Regards,
Jan

> 
> I am using 3.10.84 kernel. LTP is of latest  version (ltp-full-20150420)
> 
> Regards
> Manjeet
> 
> ------- Original Message -------
> Sender : Jan Stancek
> Date : Jul 27, 2015 17:32 (GMT+09:00)
> Title : Re: [LTP] Regarding memcg control testcase (mem_process.c)
> 
> 
> 
> 
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-29  9:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-29  3:54 [LTP] Regarding memcg control testcase (mem_process.c) Manjeet Pawar
2015-07-29  6:48 ` Jan Stancek
  -- strict thread matches above, loose matches on Subject: below --
2015-07-29  9:10 Manjeet Pawar
2015-07-27  8:12 Manjeet Pawar
2015-07-27  8:32 ` Jan Stancek
2015-07-24  4:07 Manjeet Pawar
2015-07-26 11:28 ` Jan Stancek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox