Skip to contentSkip to conversation

Bug in memory controller test - memctl test #4

LTP Mike Gahagan 2 participants 6 messages Aug 24, 2009 – Aug 30, 2009

lore
Share & tools
lore
#0 lore raw

When running the Memory Controller test # 4, I'm seeing this behavior below.

TEST 4: MEMORY CONTROLLER TESTING
RUNNING SETUP.....
TEST STARTED: Please avoid using system while this test executes /mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh: line 327: [: 62955520: unary operator expected
TINFO Memory Resource Controller: stat check test fails in first run
/mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh: line 364: [: 78704640: unary operator expected
TFAIL Memory Resource Controller: stat check test FAILED
*** infinite loop here, script exists memctl_test01 remains running ***
^Cincrementing stop

The bash error is due to the 'grep -w "active"' not matching anything so one of the variables isn't getting set like it is supposed to. I believe the test was written with an old version of the memory controller what put a field called memory.stat.active in the file memory.stat. The current memory controller I am testing appears to have replaced this field with "rss". There are fields showing anonymous and file backed pages in memory.stat, but I don't think they are ever going to match the memory.usage.in.bytes the test is looking for. Rss always matches and I believe that is what we should update the check in the test to look for. The attached patch fixes test #4 to compare memory.usage.in.bytes with rss.

run_memctl_test.sh.new renamed from testcases/kernel/controllers/memctl/run_memctl_test.sh +2 -2
@@ -323,7 +323,7 @@
 		check_mem_allocated;# $MEM_TOTAL;
 		# now we can check the memory usage from both files
 		USAGE_FROM_STAT=`cat /dev/memctl/group_1/memory.stat \
-					| grep -w "active" | cut -d" " -f2`;
+					| grep -w "rss" | cut -d" " -f2`;
 		if [ $USAGE_FROM_USAGE_IN_BYTES -eq $USAGE_FROM_STAT ]
 		then
 			echo "memory usage from memory.usage_in_bytes= $USAGE_FROM_USAGE_IN_BYTES";
@@ -360,7 +360,7 @@
 
 		# now we can check the memory usage from both files
 		USAGE_FROM_STAT=`cat /dev/memctl/group_1/memory.stat \
-					| grep -w "active" | cut -d" " -f2`;
+					| grep -w "rss" | cut -d" " -f2`;
 		if [ $USAGE_FROM_USAGE_IN_BYTESGRP1_MEMUSAGE -eq $USAGE_FROM_STAT ] \
 							&& [ $FIRST_STEP_PASS -eq 1 ]
 		then

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 14 lines · Mike Gahagan

When running the Memory Controller test # 4, I'm seeing this behavior below.

TEST 4: MEMORY CONTROLLER TESTING
RUNNING SETUP.....
TEST STARTED: Please avoid using system while this test executes /mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh:
line 327: [: 62955520: unary operator expected
TINFO Memory Resource Controller: stat check test fails in first run
/mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh:
line 364: [: 78704640: unary operator expected
TFAIL Memory Resource Controller: stat check test FAILED
*** infinite loop here, script exists memctl_test01 remains running *** ^Cincrementing stop

Quoted 4 lines

The bash error is due to the 'grep -w "active"' not matching anything so one of the variables isn't getting set like it is supposed to. I believe the test was written with an old version of the memory controller what put a field called memory.stat.active in the file memory.stat. The

Correct. Somebody needs to revisit these tests, as the ABIs has changed. Thanks for pointing that out. However, your patch has the following problem:

1) Missing Signed-off-by:
2) missing header for unified diff at line 3 of patch patching file testcases/kernel/controllers/memctl/run_memctl_test.sh

Please look into them when you send a patch next time ;-)

Regards--
Subrata

Quoted 4 lines

current memory controller I am testing appears to have replaced this field with "rss". There are fields showing anonymous and file backed pages in memory.stat, but I don't think they are ever going to match the memory.usage.in.bytes the test is looking for. Rss always matches and I

Quoted 8 lines

believe that is what we should update the check in the test to look for.
The attached patch fixes test #4 to compare memory.usage.in.bytes with rss.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw

Re: [LTP] Bug in memory controller test - memctl test #4 - PATCH repost

Quoted 24 lines · Subrata Modak
Quoted 14 lines · Mike Gahagan

When running the Memory Controller test # 4, I'm seeing this behavior below.

TEST 4: MEMORY CONTROLLER TESTING
RUNNING SETUP.....
TEST STARTED: Please avoid using system while this test executes /mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh:
line 327: [: 62955520: unary operator expected
TINFO Memory Resource Controller: stat check test fails in first run
/mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh:
line 364: [: 78704640: unary operator expected
TFAIL Memory Resource Controller: stat check test FAILED
*** infinite loop here, script exists memctl_test01 remains running *** ^Cincrementing stop

Quoted 4 lines

The bash error is due to the 'grep -w "active"' not matching anything so one of the variables isn't getting set like it is supposed to. I believe the test was written with an old version of the memory controller what put a field called memory.stat.active in the file memory.stat. The

Correct. Somebody needs to revisit these tests, as the ABIs has changed. Thanks for pointing that out. However, your patch has the following problem:

Quoted 16 lines

1) Missing Signed-off-by:
2) missing header for unified diff at line 3 of patch patching file testcases/kernel/controllers/memctl/run_memctl_test.sh

Please look into them when you send a patch next time ;-)

Regards--
Subrata

Quoted 7 lines

current memory controller I am testing appears to have replaced this field with "rss". There are fields showing anonymous and file backed pages in memory.stat, but I don't think they are ever going to match the memory.usage.in.bytes the test is looking for. Rss always matches and I believe that is what we should update the check in the test to look for. The attached patch fixes test #4 to compare memory.usage.in.bytes with rss.
------------------------------------------------------------------------------

Hello,

Here is a resubmission of my memctl test patch. It should clear up the issues noted above. No functional change from the previous patch.

 run_memctl_test.sh |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/controllers/memctl/run_memctl_test.sh +2 -2
diff -uNr ltp-full-20090731/testcases/kernel/controllers/memctl/run_memctl_test.sh ltp-full-20090731.new/testcases/kernel/controllers/memctl/run_memctl_test.sh
@@ -323,7 +323,7 @@
 		check_mem_allocated;# $MEM_TOTAL;
 		# now we can check the memory usage from both files
 		USAGE_FROM_STAT=`cat /dev/memctl/group_1/memory.stat \
-					| grep -w "active" | cut -d" " -f2`;
+					| grep -w "rss" | cut -d" " -f2`;
 		if [ $USAGE_FROM_USAGE_IN_BYTES -eq $USAGE_FROM_STAT ]
 		then
 			echo "memory usage from memory.usage_in_bytes= $USAGE_FROM_USAGE_IN_BYTES";
@@ -360,7 +360,7 @@
 
 		# now we can check the memory usage from both files
 		USAGE_FROM_STAT=`cat /dev/memctl/group_1/memory.stat \
-					| grep -w "active" | cut -d" " -f2`;
+					| grep -w "rss" | cut -d" " -f2`;
 		if [ $USAGE_FROM_USAGE_IN_BYTESGRP1_MEMUSAGE -eq $USAGE_FROM_STAT ] \
 							&& [ $FIRST_STEP_PASS -eq 1 ]
 		then

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw

Re: [LTP] Bug in memory controller test - memctl test #4 - PATCH repost

Hi,

Quoted 16 lines · Mike Gahagan
Quoted 15 lines · Subrata Modak
Quoted 14 lines · Mike Gahagan

When running the Memory Controller test # 4, I'm seeing this behavior below.

TEST 4: MEMORY CONTROLLER TESTING
RUNNING SETUP.....
TEST STARTED: Please avoid using system while this test executes /mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh:
line 327: [: 62955520: unary operator expected
TINFO Memory Resource Controller: stat check test fails in first run
/mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh:
line 364: [: 78704640: unary operator expected
TFAIL Memory Resource Controller: stat check test FAILED
*** infinite loop here, script exists memctl_test01 remains running *** ^Cincrementing stop

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

The bash error is due to the 'grep -w "active"' not matching anything so one of the variables isn't getting set like it is supposed to. I believe the test was written with an old version of the memory controller what put a field called memory.stat.active in the file memory.stat. The

Correct. Somebody needs to revisit these tests, as the ABIs has changed.

Would be able to spend some time here ?

Quoted 20 lines
Quoted 19 lines

Thanks for pointing that out. However, your patch has the following problem:

1) Missing Signed-off-by:
2) missing header for unified diff at line 3 of patch patching file testcases/kernel/controllers/memctl/run_memctl_test.sh

Please look into them when you send a patch next time ;-)

Regards--
Subrata

Quoted 7 lines

current memory controller I am testing appears to have replaced this field with "rss". There are fields showing anonymous and file backed pages in memory.stat, but I don't think they are ever going to match the memory.usage.in.bytes the test is looking for. Rss always matches and I believe that is what we should update the check in the test to look for. The attached patch fixes test #4 to compare memory.usage.in.bytes with rss.
------------------------------------------------------------------------------

Quoted 6 lines

Hello,

Here is a resubmission of my memctl test patch. It should clear up the issues noted above. No functional change from the previous patch.

Thanks. I already merged your patch.

Regards--
Subrata

Quoted 7 lines

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#4 lore raw

Re: [LTP] Bug in memory controller test - memctl test #4 - PATCH repost

Quoted 19 lines · Subrata Modak

Hi,

Quoted 16 lines · Mike Gahagan
Quoted 15 lines · Subrata Modak
Quoted 14 lines · Mike Gahagan

When running the Memory Controller test # 4, I'm seeing this behavior below.

TEST 4: MEMORY CONTROLLER TESTING
RUNNING SETUP.....
TEST STARTED: Please avoid using system while this test executes /mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh:
line 327: [: 62955520: unary operator expected
TINFO Memory Resource Controller: stat check test fails in first run
/mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh:
line 364: [: 78704640: unary operator expected
TFAIL Memory Resource Controller: stat check test FAILED
*** infinite loop here, script exists memctl_test01 remains running *** ^Cincrementing stop

Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

The bash error is due to the 'grep -w "active"' not matching anything so one of the variables isn't getting set like it is supposed to. I believe the test was written with an old version of the memory controller what put a field called memory.stat.active in the file memory.stat. The

Correct. Somebody needs to revisit these tests, as the ABIs has changed.

Would be able to spend some time here ?

Sure, I would be glad to. So far this was the only issue I have found (or the only really obvious one at least). I plan on picking up and running the recently checked in new tests as well, probably in the next week or so.

Quoted 20 lines
Quoted 20 lines
Quoted 19 lines

Thanks for pointing that out. However, your patch has the following problem:

1) Missing Signed-off-by:
2) missing header for unified diff at line 3 of patch patching file testcases/kernel/controllers/memctl/run_memctl_test.sh

Please look into them when you send a patch next time ;-)

Regards--
Subrata

Quoted 7 lines

current memory controller I am testing appears to have replaced this field with "rss". There are fields showing anonymous and file backed pages in memory.stat, but I don't think they are ever going to match the memory.usage.in.bytes the test is looking for. Rss always matches and I believe that is what we should update the check in the test to look for. The attached patch fixes test #4 to compare memory.usage.in.bytes with rss.
------------------------------------------------------------------------------

Quoted 9 lines
Quoted 6 lines

Hello,

Here is a resubmission of my memctl test patch. It should clear up the issues noted above. No functional change from the previous patch.

Thanks. I already merged your patch.

Thank you !

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#5 lore raw

Re: [LTP] Bug in memory controller test - memctl test #4 - PATCH repost

Quoted 27 lines · Mike Gahagan
Quoted 26 lines · Subrata Modak

Hi,

Quoted 22 lines · Mike Gahagan
Quoted 21 lines · Subrata Modak
Quoted 14 lines · Mike Gahagan

When running the Memory Controller test # 4, I'm seeing this behavior below.

TEST 4: MEMORY CONTROLLER TESTING
RUNNING SETUP.....
TEST STARTED: Please avoid using system while this test executes /mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh:
line 327: [: 62955520: unary operator expected
TINFO Memory Resource Controller: stat check test fails in first run
/mnt/tests/kernel/distribution/ltp/20090731/ltp-full-20090731/testcases/bin/run_memctl_test.sh:
line 364: [: 78704640: unary operator expected
TFAIL Memory Resource Controller: stat check test FAILED
*** infinite loop here, script exists memctl_test01 remains running *** ^Cincrementing stop

Quoted 4 lines

The bash error is due to the 'grep -w "active"' not matching anything so one of the variables isn't getting set like it is supposed to. I believe the test was written with an old version of the memory controller what put a field called memory.stat.active in the file memory.stat. The

Correct. Somebody needs to revisit these tests, as the ABIs has changed.

Quoted 7 lines
Quoted 2 lines

Would be able to spend some time here ?

Sure, I would be glad to. So far this was the only issue I have found (or the only really obvious one at least). I plan on picking up and running the recently checked in new tests as well, probably in the next week or so.

Great. Thanks for this interest.

Regards--
Subrata

Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 6 lines

Thanks for pointing that out. However, your patch has the following problem:

Quoted 16 lines

1) Missing Signed-off-by:
2) missing header for unified diff at line 3 of patch patching file testcases/kernel/controllers/memctl/run_memctl_test.sh

Please look into them when you send a patch next time ;-)

Regards--
Subrata

Quoted 7 lines

current memory controller I am testing appears to have replaced this field with "rss". There are fields showing anonymous and file backed pages in memory.stat, but I don't think they are ever going to match the memory.usage.in.bytes the test is looking for. Rss always matches and I believe that is what we should update the check in the test to look for. The attached patch fixes test #4 to compare memory.usage.in.bytes with rss.
------------------------------------------------------------------------------

Hello,

Here is a resubmission of my memctl test patch. It should clear up the issues noted above. No functional change from the previous patch.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Thanks. I already merged your patch.

Thank you !

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list