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" 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<[email protected]>
Date : Jul 26, 2015 20:28 (GMT+09:00)
Title : Re: [LTP] Regarding memcg control testcase (mem_process.c)
----- Original Message -----
Quoted 14 lines
From: "Manjeet Pawar"
To: [email protected]
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.
Quoted 7 lines
-----------------------------
# Check if the test process is killed on crossing boundarytest_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
Quoted 17 lines
#Instruct the test process to start acquiring memory echo m > $STATUS_PIPE
sleep 5#Check if killed
ps -p $! >/dev/null2>/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
}
-------------------------
Quoted 8 lines
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
Quoted 7 lines
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
----- Original Message -----
Quoted 11 lines
From: "Manjeet Pawar" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: [email protected], "AJEET YADAV" <[email protected]>, "PANKAJ MISHRA" <[email protected]>
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?
Quoted 1 line
sometimes or "a successful mmap call".
Where is this message coming from? I can't find such string in my LTP.
Quoted 6 lines
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_processgetting 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
Quoted 81 lines
Regards
Manjeet------- Original Message -------
Sender : Jan Stancek<[email protected]>
Date : Jul 26, 2015 20:28 (GMT+09:00)
Title : Re: [LTP] Regarding memcg control testcase (mem_process.c)----- Original Message -----
Quoted 15 lines
From: "Manjeet Pawar"
To: [email protected]
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.Quoted 7 lines
-----------------------------
# Check if the test process is killed on crossing boundarytest_proc_kill()
{
( cd $TMP &&mem_process-m $PROC_MEM & ) sleep 1
echo $! > tasks
mem_processis 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=$!
popdsleep 1
echo $pid > tasksQuoted 19 lines
#Instruct the test process to start acquiring memory echo m > $STATUS_PIPE
sleep 5#Check if killed
ps -p $! >/dev/null2>/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, butQuoted 8 lines
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_processgetting killed by OOM seems like expected outcome:
memcg_control0 TINFO : Test #1: Checking if the memory usage limit
imposed by the topmost group is enforced
./memcg_control_test.sh: line 56: 2795 Killedmem_process
-m $PROC_MEM (wd: /tmp)
Quoted 17 lines
memcg_control 1 TPASS : Test #1: passed memcg_control 1 TPASS : memcg_control: passedIf it still doesn't get killed, I'd recommend checking "memory.usage_in_bytes".
Regards,
JanQuoted 7 lines
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list