From: Jan Stancek <jstancek@redhat.com>
To: manjeet p <manjeet.p@samsung.com>
Cc: ajeet y <ajeet.y@samsung.com>,
ltp-list@lists.sourceforge.net, pankaj m <pankaj.m@samsung.com>
Subject: Re: [LTP] Regarding memcg control testcase (mem_process.c)
Date: Sun, 26 Jul 2015 07:28:48 -0400 (EDT) [thread overview]
Message-ID: <1850032319.178415.1437910128151.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1292620122.336321437710865744.JavaMail.weblogic@epmlwas09d>
----- 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
next prev parent reply other threads:[~2015-07-26 11:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-24 4:07 [LTP] Regarding memcg control testcase (mem_process.c) Manjeet Pawar
2015-07-26 11:28 ` Jan Stancek [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-07-27 8:12 Manjeet Pawar
2015-07-27 8:32 ` Jan Stancek
2015-07-29 3:54 Manjeet Pawar
2015-07-29 6:48 ` Jan Stancek
2015-07-29 9:10 Manjeet Pawar
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=1850032319.178415.1437910128151.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=ajeet.y@samsung.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=manjeet.p@samsung.com \
--cc=pankaj.m@samsung.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.