KSM: full_scans will stop increasing after stopping ksm
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 11 lines · Bian Naimeng
Quoted 6 lines · Qian Cai
Quoted 3 lines · Bian Naimeng
There are some problem in ksm tests.
1. We should break the test when checking is failure.
No, this is not the intention. The design here is to run all tests to check for all stats to give a full picture even if the a single failure has been observed. This type of the failures do not prevent the rest of the tests from running, so there is no need to stop the tests now which also give more insight to track down root causes.
Various reason can make checking failure, someone can make the test hangup.
I did this test on RHEL5, i found ksmd stopped before doing "echo 2 >/sys/kernel/mm/ksm/run",
Sorry, it's RHEL6.
Regards
Bian
Quoted 139 lines
so
group_checkwill be hanged on "new_num<old_num* 3".So, i think we should break the test if "run" is not expecting.
Quoted 3 lines
Quoted 2 lines
2. The condition "
new_num<old_num* 3" seems uncomfortable, i think it should be "new_num<old_num+ 3"I don't understand. What error did you see from the testing output?
Sometimes, the
old_numis a big number, so it takes long time in this loop, i don't understand the purpose.
Would you explain to me why we expect this condition "new_num<old_num* 3".Quoted 5 lines
Quoted 3 lines
3. After stopping ksm(echo 2 >
/sys/kernel/mm/ksm/run), the ksmd will stop scaning pages, so looping in "new_num<old_num* 3" is wrong.Ditto.
After stopping ksm, looping in "
new_num<old_num* 3" will make the process hang up, becausenew_numdoes not be increased.Regards
BianQuoted 96 lines
CAI Qian
Quoted 95 lines
Signed-off-by Bian Naimeng <[email protected]>---
testcases/kernel/mem/include/mem.h| 2 +-testcases/kernel/mem/lib/mem.c| 19 ++++++++++---------2 files changed, 11 insertions(+), 10 deletions(-)testcases/kernel/mem/include/mem.h +1
-1@@ -42,7 +42,7 @@ void check(char *path, long int value);void verify (char value,int proc,int start,int end,int start2,int end2);void group_check (int run,int pages_shared,int pages_sharing,int pages_volatile,int pages_unshared,int sleep_millisecs, -int pages_to_scan); +int pages_to_scan,int scans);void create_same_memory (int size,int num,int unit);void check_ksm_options (int *size,int *num,int *unit);void write_cpusets (void );testcases/kernel/mem/lib/mem.c +9
-8@@ -284,7 +284,7 @@ void check(char *path, long int value)tst_resm (TINFO ,"%s is %ld." , path,atol (buf));if (atol (buf) != value) -tst_resm (TFAIL ,"%s is not %ld." , path, value); +tst_brkm (TFAIL , tst_exit,"%s is not %ld." , path, value); }void verify (char value,int proc,int start,int end,int start2,int end2)@@ -312,7 +312,8 @@ void verify(char value, int proc, int start, int end, int start2, int end2)void group_check (int run,int pages_shared,int pages_sharing,int pages_volatile,int pages_unshared, -int sleep_millisecs,int pages_to_scan) +int sleep_millisecs,int pages_to_scan, +int scans) {int fd;char buf[BUFSIZ ];@@ -332,7 +333,7 @@ void group_check(int run, int pages_shared, int pages_sharing, old_num = new_num =atoi (buf);if (lseek (fd,0 ,SEEK_SET ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"lseek" ); -while (new_num < old_num *3 ) { +while (new_num < old_num + scans) {sleep (1 );if (read (fd, buf,BUFSIZ ) <0 )tst_brkm (TBROK |TERRNO , cleanup,"read" );@@ -587,7 +588,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num,3 );tst_resm (TINFO ,"wait for child 1 to stop." );if (waitpid (child[1 ], &status,WUNTRACED ) ==-1 )@@ -599,7 +600,7 @@ void create_same_memory(int size, int num, int unit)tst_resm (TINFO ,"resume child 1." );if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num,3 );tst_resm (TINFO ,"wait for child 1 to stop." );if (waitpid (child[1 ], &status,WUNTRACED ) ==-1 )@@ -613,7 +614,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num,3 );tst_resm (TINFO ,"wait for all children to stop." );for (k =0 ; k < num; k++) {@@ -627,7 +628,7 @@ void create_same_memory(int size, int num, int unit)tst_resm (TINFO ,"resume child 1." );if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num,3 );tst_resm (TINFO ,"wait for child 1 to stop." );if (waitpid (child[1 ], &status,WUNTRACED ) ==-1 )@@ -647,7 +648,7 @@ void create_same_memory(int size, int num, int unit)tst_brkm (TBROK |TERRNO , cleanup,"open" );if (write (fd,"2" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" ); -group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );Quoted 16 lines
Quoted 15 lines
testcases/kernel/mem/lib/mem.c +1
-1tst_resm (TINFO ,"wait for all children to stop." );for (k =0 ; k < num; k++) {@@ -668,7 +669,7 @@ void create_same_memory(int size, int num, int unit)if (write (fd,"0" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" );close (fd); -group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );while (waitpid (-1 , &status,WUNTRACED |WCONTINUED ) >0 )if (WEXITSTATUS (status) !=0 ) tst_resm(TFAIL, "child exit status is %d",Signature · 1 line
1.7.1
Quoted 12 lines
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
----- Original Message -----
Quoted 13 lines
Quoted 11 lines · Qian Cai
Quoted 3 lines · Bian Naimeng
There are some problem in ksm tests.
1. We should break the test when checking is failure.
No, this is not the intention. The design here is to run all tests to check for all stats to give a full picture even if the a single failure has been observed. This type of the failures do not prevent the rest of the tests from running, so there is no need to stop the tests now which also give more insight to track down root causes.
Quoted 7 lines
Various reason can make checking failure, someone can make the test hangup.
I did this test on RHEL5, i found ksmd stopped before doing "echo 2 >/sys/kernel/mm/ksm/run",
sogroup_checkwill be hanged on "new_num<old_num* 3".So, i think we should break the test if "run" is not expecting.
What happened if you run the tests for a recent upstream kernel? There are some patches for ksm recently merged upstream. If the problem still persistent, please paste the EXACT OUTPUT from the ksm01 test. If it is hung, please upload sysrq-t output somewhere.
CAI Qian
Quoted 160 lines
Quoted 4 lines
Quoted 3 lines
2. The condition "
new_num<old_num* 3" seems uncomfortable, i think
it should be "new_num<old_num+ 3"I don't understand. What error did you see from the testing output?
Sometimes, the
old_numis a big number, so it takes long time in this loop,
i don't understand the purpose.
Would you explain to me why we expect this condition "new_num<old_num* 3".Quoted 5 lines
Quoted 3 lines
3. After stopping ksm(echo 2 >
/sys/kernel/mm/ksm/run), the ksmd will stop scaning pages, so looping in "new_num<old_num* 3" is wrong.Ditto.
After stopping ksm, looping in "
new_num<old_num* 3" will make the process hang up,
becausenew_numdoes not be increased.Regards
BianQuoted 115 lines
CAI Qian
Quoted 114 lines
Signed-off-by Bian Naimeng <[email protected]>---
testcases/kernel/mem/include/mem.h| 2 +-testcases/kernel/mem/lib/mem.c| 19 ++++++++++---------2 files changed, 11 insertions(+), 10 deletions(-)testcases/kernel/mem/include/mem.h +1
-1@@ -42,7 +42,7 @@ void check(char *path, long int value);void verify (char value,int proc,int start,int end,int start2,int end2);void group_check (int run,int pages_shared,int pages_sharing,int pages_volatile,int pages_unshared,int sleep_millisecs, -int pages_to_scan); +int pages_to_scan,int scans);void create_same_memory (int size,int num,int unit);void check_ksm_options (int *size,int *num,int *unit);void
write_cpusets(void);testcases/kernel/mem/lib/mem.c +1
-1@@ -284,7 +284,7 @@ void check(char *path, long int value)tst_resm (TINFO ,"%s is %ld." , path,atol (buf));if (atol (buf) != value) -tst_resm (TFAIL ,"%s is not %ld." , path, value); +tst_brkm (TFAIL , tst_exit,"%s is not %ld." , path, value); } void verify(char value, int proc, int start, int end, int start2,int end2)
testcases/kernel/mem/lib/mem.c +2
-1@@ -312,7 +312,8 @@ void verify(char value, int proc, int start, int end, int start2, int end2) void group_check(int run, int pages_shared, int pages_sharing, int pages_volatile, int pages_unshared, - int sleep_millisecs, int pages_to_scan) + int sleep_millisecs, int pages_to_scan, + int scans) { int fd;char buf[BUFSIZ];testcases/kernel/mem/lib/mem.c +1
-1@@ -332,7 +333,7 @@ void group_check(int run, int pages_shared, int pages_sharing, old_num = new_num =atoi (buf);if (lseek (fd,0 ,SEEK_SET ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"lseek" ); -while (new_num < old_num *3 ) { +while (new_num < old_num + scans) {sleep (1 );if (read (fd, buf,BUFSIZ ) <0 )tst_brkm(TBROK|TERRNO, cleanup, "read");testcases/kernel/mem/lib/mem.c +1
-1@@ -587,7 +588,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -599,7 +600,7 @@ void create_same_memory(int size, int num, int unit) tst_resm(TINFO, "resume child 1.");if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -613,7 +614,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for all children to stop."); for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +1
-1@@ -627,7 +628,7 @@ void create_same_memory(int size, int num, int unit) tst_resm(TINFO, "resume child 1.");if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -647,7 +648,7 @@ void create_same_memory(int size, int num, int unit) tst_brkm(TBROK|TERRNO, cleanup, "open");if (write (fd,"2" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" ); -group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );Quoted 18 lines
Quoted 11 lines
testcases/kernel/mem/lib/mem.c +0
-0tst_resm (TINFO ,"wait for all children to stop." );for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +1
-1@@ -668,7 +669,7 @@ void create_same_memory(int size, int num, int unit)if (write (fd,"0" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" );close (fd); -group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );while (waitpid (-1 , &status,WUNTRACED |WCONTINUED ) >0 )if (WEXITSTATUS (status) !=0 )Quoted 5 lines
tst_resm(TFAIL, "child exit status is %d",
--
1.7.1
Quoted 10 lines
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 19 lines · CAI Qian
----- Original Message -----
Quoted 17 lines
Quoted 10 lines · Qian Cai
Quoted 3 lines · Bian Naimeng
There are some problem in ksm tests.
1. We should break the test when checking is failure.
No, this is not the intention. The design here is to run all tests to check for all stats to give a full picture even if the a single failure has been observed. This type of the failures do not prevent the rest of the tests from running, so there is no need to stop the tests now which also give more insight to track down root causes.
Various reason can make checking failure, someone can make the test hangup.
I did this test on RHEL5, i found ksmd stopped before doing "echo 2 >/sys/kernel/mm/ksm/run",
sogroup_checkwill be hanged on "new_num<old_num* 3".
Quoted 6 lines
Quoted 1 line
So, i think we should break the test if "run" is not expecting.
What happened if you run the tests for a recent upstream kernel? There are some patches for ksm recently merged upstream. If the problem still persistent, please paste the EXACT OUTPUT from the ksm01 test. If it is hung, please upload sysrq-t output somewhere.
Maybe there are some bugs in the RHEL6's kernel, but the purpose of this patch is not to workround these bugs, i want to fix the test's bug.
Would you explain to me why we do this loop "while (new_num < old_num * 3)" in group_check, i think "while (new_num < old_num + 3)" is better.
Some time ago, the following patch insert this loop.
http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTi%3Dg%3DojJu0m%2B556rnekYenRTXtX%2BVBOj%3DrPmnjSw%40mail.gmail.com&forum_name=ltp-list
The changelog of this patch said "we should wait 3~5 increments of the /sys/kernel/mm/ksm/full_scans before checking ksm* testcases's results", but it do "while (new_num < old_num * 3)" actually.
Regards
Bian
Quoted 170 lines
CAI Qian
Quoted 166 lines
Quoted 4 lines
Quoted 3 lines
2. The condition "
new_num<old_num* 3" seems uncomfortable, i think
it should be "new_num<old_num+ 3"I don't understand. What error did you see from the testing output?
Sometimes, the
old_numis a big number, so it takes long time in this loop,
i don't understand the purpose.
Would you explain to me why we expect this condition "new_num<old_num* 3".Quoted 5 lines
Quoted 3 lines
3. After stopping ksm(echo 2 >
/sys/kernel/mm/ksm/run), the ksmd will stop scaning pages, so looping in "new_num<old_num* 3" is wrong.Ditto.
After stopping ksm, looping in "
new_num<old_num* 3" will make the process hang up,
becausenew_numdoes not be increased.Regards
BianQuoted 115 lines
CAI Qian
Quoted 114 lines
Signed-off-by Bian Naimeng <[email protected]>---
testcases/kernel/mem/include/mem.h| 2 +-testcases/kernel/mem/lib/mem.c| 19 ++++++++++---------2 files changed, 11 insertions(+), 10 deletions(-)testcases/kernel/mem/include/mem.h +1
-1@@ -42,7 +42,7 @@ void check(char *path, long int value);void verify (char value,int proc,int start,int end,int start2,int end2);void group_check (int run,int pages_shared,int pages_sharing,int pages_volatile,int pages_unshared,int sleep_millisecs, -int pages_to_scan); +int pages_to_scan,int scans);void create_same_memory (int size,int num,int unit);void check_ksm_options (int *size,int *num,int *unit);void
write_cpusets(void);testcases/kernel/mem/lib/mem.c +1
-1@@ -284,7 +284,7 @@ void check(char *path, long int value)tst_resm (TINFO ,"%s is %ld." , path,atol (buf));if (atol (buf) != value) -tst_resm (TFAIL ,"%s is not %ld." , path, value); +tst_brkm (TFAIL , tst_exit,"%s is not %ld." , path, value); } void verify(char value, int proc, int start, int end, int start2,int end2)
testcases/kernel/mem/lib/mem.c +2
-1@@ -312,7 +312,8 @@ void verify(char value, int proc, int start, int end, int start2, int end2) void group_check(int run, int pages_shared, int pages_sharing, int pages_volatile, int pages_unshared, - int sleep_millisecs, int pages_to_scan) + int sleep_millisecs, int pages_to_scan, + int scans) { int fd;char buf[BUFSIZ];testcases/kernel/mem/lib/mem.c +1
-1@@ -332,7 +333,7 @@ void group_check(int run, int pages_shared, int pages_sharing, old_num = new_num =atoi (buf);if (lseek (fd,0 ,SEEK_SET ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"lseek" ); -while (new_num < old_num *3 ) { +while (new_num < old_num + scans) {sleep (1 );if (read (fd, buf,BUFSIZ ) <0 )tst_brkm(TBROK|TERRNO, cleanup, "read");testcases/kernel/mem/lib/mem.c +1
-1@@ -587,7 +588,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -599,7 +600,7 @@ void create_same_memory(int size, int num, int unit) tst_resm(TINFO, "resume child 1.");if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -613,7 +614,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for all children to stop."); for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +1
-1@@ -627,7 +628,7 @@ void create_same_memory(int size, int num, int unit) tst_resm(TINFO, "resume child 1.");if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -647,7 +648,7 @@ void create_same_memory(int size, int num, int unit) tst_brkm(TBROK|TERRNO, cleanup, "open");if (write (fd,"2" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" ); -group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );Quoted 17 lines
Quoted 11 lines
testcases/kernel/mem/lib/mem.c +0
-0tst_resm (TINFO ,"wait for all children to stop." );for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +1
-1@@ -668,7 +669,7 @@ void create_same_memory(int size, int num, int unit)if (write (fd,"0" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" );close (fd); -group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );while (waitpid (-1 , &status,WUNTRACED |WCONTINUED ) >0 )if (WEXITSTATUS (status) !=0 )Quoted 5 lines
tst_resm(TFAIL, "child exit status is %d",
--
1.7.1------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
----- Original Message -----
Quoted 37 lines
Quoted 22 lines · CAI Qian
----- Original Message -----
Quoted 20 lines
Quoted 4 lines · Qian Cai
Quoted 2 lines · Bian Naimeng
There are some problem in ksm tests.
Quoted 8 lines
Quoted 1 line
1. We should break the test when checking is failure.
No, this is not the intention. The design here is to run all tests to check for all stats to give a full picture even if the a single failure has been observed. This type of the failures do not prevent
the rest of the tests from running, so there is no need to stop the
tests now which also give more insight to track down root causes.Various reason can make checking failure, someone can make the test hangup.
I did this test on RHEL5, i found ksmd stopped before doing "echo 2Quoted 1 line
/sys/kernel/mm/ksm/run",
sogroup_checkwill be hanged on "new_num<old_num* 3".Quoted 9 lines
Quoted 1 line
So, i think we should break the test if "run" is not expecting.
What happened if you run the tests for a recent upstream kernel? There
are some patches for ksm recently merged upstream. If the problem still
persistent, please paste the EXACT OUTPUT from the ksm01 test. If it is
hung, please upload sysrq-t output somewhere.Maybe there are some bugs in the RHEL6's kernel, but the purpose of this patch
is not to workround these bugs, i want to fix the test's bug.
Quoted 6 lines
Would you explain to me why we do this loop "while (
new_num<old_num
* 3)" ingroup_check, i think "while (new_num<old_num+ 3)" is better.Some time ago, the following patch insert this loop.
http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTi%3Dg%3DojJu0m%2B556rnekYenRTXtX%2BVBOj%3DrPmnjSw%40mail.gmail.com&forum_name=ltp-list
Right, that patch is indeed buggy. In the case of ksm stopped, the ksmd will stop to scan, so won't be able to break the wait loop. In that case, there is no need to wait for ksmd to scan 3 times. Pingtian, can you fix that and incooperate the patch from Bian?
CAI Qian
Quoted 5 lines
The changelog of this patch said "we should wait 3~5 increments of the
/sys/kernel/mm/ksm/full_scansbefore checking ksm* testcases's results", but
it do "while (new_num<old_num* 3)" actually.
Quoted 184 lines
Regards
BianQuoted 181 lines
CAI Qian
Quoted 177 lines
Quoted 5 lines
Quoted 3 lines
2. The condition "
new_num<old_num* 3" seems uncomfortable, i think
it should be "new_num<old_num+ 3"I don't understand. What error did you see from the testing output?
Sometimes, the
old_numis a big number, so it takes long time in this
loop,
i don't understand the purpose.
Would you explain to me why we expect this condition "new_num<old_num* 3".Quoted 5 lines
Quoted 3 lines
3. After stopping ksm(echo 2 >
/sys/kernel/mm/ksm/run), the ksmd will stop scaning pages, so looping in "new_num<old_num* 3" is wrong.Ditto.
After stopping ksm, looping in "
new_num<old_num* 3" will make the
process hang up,
becausenew_numdoes not be increased.Regards
BianQuoted 131 lines
CAI Qian
Quoted 130 lines
Signed-off-by Bian Naimeng <[email protected]>---
testcases/kernel/mem/include/mem.h| 2 +-testcases/kernel/mem/lib/mem.c| 19 ++++++++++---------2 files changed, 11 insertions(+), 10 deletions(-)testcases/kernel/mem/include/mem.h +1
-1@@ -42,7 +42,7 @@ void check(char *path, long int value);void verify (char value,int proc,int start,int end,int start2,int end2);void group_check (int run,int pages_shared,int pages_sharing,int pages_volatile,int pages_unshared,int sleep_millisecs, -int pages_to_scan); +int pages_to_scan,int scans);void create_same_memory (int size,int num,int unit);void
check_ksm_options(int *size, int *num, int *unit); voidwrite_cpusets(void);testcases/kernel/mem/lib/mem.c +1
-1@@ -284,7 +284,7 @@ void check(char *path, long int value)tst_resm (TINFO ,"%s is %ld." , path,atol (buf));if (atol (buf) != value) -tst_resm (TFAIL ,"%s is not %ld." , path, value); +tst_brkm (TFAIL , tst_exit,"%s is not %ld." , path, value); } void verify(char value, int proc, int start, int end, int start2,int end2)
testcases/kernel/mem/lib/mem.c +2
-1@@ -312,7 +312,8 @@ void verify(char value, int proc, int start, int end, int start2, int end2) void group_check(int run, int pages_shared, int pages_sharing, int pages_volatile, int pages_unshared, - int sleep_millisecs, int pages_to_scan) + int sleep_millisecs, int pages_to_scan, + int scans) { int fd;char buf[BUFSIZ];testcases/kernel/mem/lib/mem.c +0
-0@@ -332,7 +333,7 @@ void group_check(int run, int pages_shared,int
pages_sharing,old_num = new_num = atoi(buf); if (lseek(fd, 0, SEEK_SET) == -1) tst_brkm(TBROK|TERRNO, cleanup, "lseek"); - while (new_num < old_num * 3) { + while (new_num < old_num + scans) { sleep(1); if (read(fd, buf, BUFSIZ) < 0) tst_brkm(TBROK|TERRNO, cleanup, "read");testcases/kernel/mem/lib/mem.c +0
-0@@ -587,7 +588,7 @@ void create_same_memory(int size, int num,int
unit)if (kill(child[k], SIGCONT) == -1) tst_brkm(TBROK|TERRNO, cleanup, "kill child[%d]", k);}
-group_check(1, 2, size * num * 256 - 2, 0, 0, 0, size * 256 * num);
+group_check(1, 2, size * num * 256 - 2, 0, 0, 0, size * 256 * num, 3);tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +0
-0@@ -599,7 +600,7 @@ void create_same_memory(int size, int num,int
unit)tst_resm(TINFO, "resume child 1."); if (kill(child[1], SIGCONT) == -1) tst_brkm(TBROK|TERRNO, cleanup, "kill");-
group_check(1, 3, size * num * 256 - 3, 0, 0, 0, size * 256 * num);
+group_check(1, 3, size * num * 256 - 3, 0, 0, 0, size * 256 * num, 3);tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +0
-0@@ -613,7 +614,7 @@ void create_same_memory(int size, int num,int
unit)if (kill(child[k], SIGCONT) == -1) tst_brkm(TBROK|TERRNO, cleanup, "kill child[%d]", k);}
-group_check(1, 1, size * num * 256 - 1, 0, 0, 0, size * 256 * num);
+group_check(1, 1, size * num * 256 - 1, 0, 0, 0, size * 256 * num, 3);tst_resm(TINFO, "wait for all children to stop."); for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +0
-0@@ -627,7 +628,7 @@ void create_same_memory(int size, int num,int
unit)tst_resm(TINFO, "resume child 1."); if (kill(child[1], SIGCONT) == -1) tst_brkm(TBROK|TERRNO, cleanup, "kill");-
group_check(1, 1, size * num * 256 - 2, 0, 1, 0, size * 256 * num);
+group_check(1, 1, size * num * 256 - 2, 0, 1, 0, size * 256 * num, 3);tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +0
-0@@ -647,7 +648,7 @@ void create_same_memory(int size, int num,int
unit)tst_brkm(TBROK|TERRNO, cleanup, "open"); if (write(fd, "2", 1) != 1) tst_brkm(TBROK|TERRNO, cleanup, "write");-
group_check(2, 0, 0, 0, 0, 0, size * 256 * num);
+group_check(2, 0, 0, 0, 0, 0, size * 256 * num, 0);tst_resm(TINFO, "wait for all children to stop."); for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +0
-0@@ -668,7 +669,7 @@ void create_same_memory(int size, int num,int
unit)
if (write(fd, "0", 1)!= 1)tst_brkm(TBROK|TERRNO, cleanup, "write");close(fd);
-group_check(0, 0, 0, 0, 0, 0, size * 256 * num);Quoted 9 lines
Quoted 8 lines
+
group_check(0, 0, 0, 0, 0, 0, size * 256 * num, 0); while (waitpid(-1, &status, WUNTRACED | WCONTINUED)> 0) if (WEXITSTATUS(status) != 0) tst_resm(TFAIL, "child exit status is %d",
--
1.7.1------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 35 lines · Bian Naimeng
Quoted 19 lines · CAI Qian
----- Original Message -----
Quoted 17 lines
Quoted 10 lines · Qian Cai
Quoted 3 lines · Bian Naimeng
There are some problem in ksm tests.
1. We should break the test when checking is failure.
No, this is not the intention. The design here is to run all tests to check for all stats to give a full picture even if the a single failure has been observed. This type of the failures do not prevent the rest of the tests from running, so there is no need to stop the tests now which also give more insight to track down root causes.
Various reason can make checking failure, someone can make the test hangup.
I did this test on RHEL5, i found ksmd stopped before doing "echo 2 >/sys/kernel/mm/ksm/run",
sogroup_checkwill be hanged on "new_num<old_num* 3".Quoted 6 lines
Quoted 1 line
So, i think we should break the test if "run" is not expecting.
What happened if you run the tests for a recent upstream kernel? There are some patches for ksm recently merged upstream. If the problem still persistent, please paste the EXACT OUTPUT from the ksm01 test. If it is hung, please upload sysrq-t output somewhere.
Maybe there are some bugs in the RHEL6's kernel, but the purpose of this patch is not to workround these bugs, i want to fix the test's bug.
Would you explain to me why we do this loop "while (
new_num<old_num* 3)" ingroup_check, i think "while (new_num<old_num+ 3)" is better.
Quoted 6 lines
Some time ago, the following patch insert this loop.
http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTi%3Dg%3DojJu0m%2B556rnekYenRTXtX%2BVBOj%3DrPmnjSw%40mail.gmail.com&forum_name=ltp-listThe changelog of this patch said "we should wait 3~5 increments of the
/sys/kernel/mm/ksm/full_scansbefore checking ksm* testcases's results", but it do "while (new_num<old_num* 3)" actually.
I made a mistake. The code is what I wanted to do, but the changelog was wrong. When testing the new ksm patch, the developer told us we must wait 3~5 times increments of the number before checking testing results. So I coded to wait til new_num >= old_num * 3 before checking the results.
About 'echo 2 > /sys/kernel/mm/ksm/run' problem, I have tested it with ksm01.
If I run the 'echo 2 > /sys/kernel/mm/ksm/run' before issue ksm test, the content of /sys/kernel/mm/ksm/run will be changed to 1 and the test can finished successfully. Only if I echo the 2 between the testing process, ksm01 will hang up. On that time, new_num will be zero, so your plus 3 method won't work either. So what should we do in this circumstance?
Thanks.
Han Pingtian
Quoted 186 lines
Regards
BianQuoted 170 lines
CAI Qian
Quoted 166 lines
Quoted 4 lines
Quoted 3 lines
2. The condition "
new_num<old_num* 3" seems uncomfortable, i think
it should be "new_num<old_num+ 3"I don't understand. What error did you see from the testing output?
Sometimes, the
old_numis a big number, so it takes long time in this loop,
i don't understand the purpose.
Would you explain to me why we expect this condition "new_num<old_num* 3".Quoted 5 lines
Quoted 3 lines
3. After stopping ksm(echo 2 >
/sys/kernel/mm/ksm/run), the ksmd will stop scaning pages, so looping in "new_num<old_num* 3" is wrong.Ditto.
After stopping ksm, looping in "
new_num<old_num* 3" will make the process hang up,
becausenew_numdoes not be increased.Regards
BianQuoted 115 lines
CAI Qian
Quoted 114 lines
Signed-off-by Bian Naimeng <[email protected]>---
testcases/kernel/mem/include/mem.h| 2 +-testcases/kernel/mem/lib/mem.c| 19 ++++++++++---------2 files changed, 11 insertions(+), 10 deletions(-)testcases/kernel/mem/include/mem.h +1
-1@@ -42,7 +42,7 @@ void check(char *path, long int value);void verify (char value,int proc,int start,int end,int start2,int end2);void group_check (int run,int pages_shared,int pages_sharing,int pages_volatile,int pages_unshared,int sleep_millisecs, -int pages_to_scan); +int pages_to_scan,int scans);void create_same_memory (int size,int num,int unit);void check_ksm_options (int *size,int *num,int *unit);void
write_cpusets(void);testcases/kernel/mem/lib/mem.c +1
-1@@ -284,7 +284,7 @@ void check(char *path, long int value)tst_resm (TINFO ,"%s is %ld." , path,atol (buf));if (atol (buf) != value) -tst_resm (TFAIL ,"%s is not %ld." , path, value); +tst_brkm (TFAIL , tst_exit,"%s is not %ld." , path, value); } void verify(char value, int proc, int start, int end, int start2,int end2)
testcases/kernel/mem/lib/mem.c +2
-1@@ -312,7 +312,8 @@ void verify(char value, int proc, int start, int end, int start2, int end2) void group_check(int run, int pages_shared, int pages_sharing, int pages_volatile, int pages_unshared, - int sleep_millisecs, int pages_to_scan) + int sleep_millisecs, int pages_to_scan, + int scans) { int fd;char buf[BUFSIZ];testcases/kernel/mem/lib/mem.c +1
-1@@ -332,7 +333,7 @@ void group_check(int run, int pages_shared, int pages_sharing, old_num = new_num =atoi (buf);if (lseek (fd,0 ,SEEK_SET ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"lseek" ); -while (new_num < old_num *3 ) { +while (new_num < old_num + scans) {sleep (1 );if (read (fd, buf,BUFSIZ ) <0 )tst_brkm(TBROK|TERRNO, cleanup, "read");testcases/kernel/mem/lib/mem.c +1
-1@@ -587,7 +588,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -599,7 +600,7 @@ void create_same_memory(int size, int num, int unit) tst_resm(TINFO, "resume child 1.");if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -613,7 +614,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for all children to stop."); for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +1
-1@@ -627,7 +628,7 @@ void create_same_memory(int size, int num, int unit) tst_resm(TINFO, "resume child 1.");if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -647,7 +648,7 @@ void create_same_memory(int size, int num, int unit) tst_brkm(TBROK|TERRNO, cleanup, "open");if (write (fd,"2" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" ); -group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );Quoted 17 lines
Quoted 11 lines
testcases/kernel/mem/lib/mem.c +0
-0tst_resm (TINFO ,"wait for all children to stop." );for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +1
-1@@ -668,7 +669,7 @@ void create_same_memory(int size, int num, int unit)if (write (fd,"0" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" );close (fd); -group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );while (waitpid (-1 , &status,WUNTRACED |WCONTINUED ) >0 )if (WEXITSTATUS (status) !=0 )Quoted 5 lines
tst_resm(TFAIL, "child exit status is %d",
--
1.7.1------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Signature · 16 lines
Han Pingtian Quality Engineer hpt @ #kernel-qe Red Hat, Inc Freedom ... courage ... Commitment ... ACCOUNTABILITY ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 36 lines · Han Pingtian
Quoted 35 lines · Bian Naimeng
Quoted 18 lines · CAI Qian
----- Original Message -----
Quoted 17 lines
Quoted 10 lines · Qian Cai
Quoted 3 lines · Bian Naimeng
There are some problem in ksm tests.
1. We should break the test when checking is failure.
No, this is not the intention. The design here is to run all tests to check for all stats to give a full picture even if the a single failure has been observed. This type of the failures do not prevent the rest of the tests from running, so there is no need to stop the tests now which also give more insight to track down root causes.
Various reason can make checking failure, someone can make the test hangup.
I did this test on RHEL5, i found ksmd stopped before doing "echo 2 >/sys/kernel/mm/ksm/run",
sogroup_checkwill be hanged on "new_num<old_num* 3".Quoted 6 lines
Quoted 1 line
So, i think we should break the test if "run" is not expecting.
What happened if you run the tests for a recent upstream kernel? There are some patches for ksm recently merged upstream. If the problem still persistent, please paste the EXACT OUTPUT from the ksm01 test. If it is hung, please upload sysrq-t output somewhere.
Maybe there are some bugs in the RHEL6's kernel, but the purpose of this patch is not to workround these bugs, i want to fix the test's bug.
Would you explain to me why we do this loop "while (
new_num<old_num* 3)" ingroup_check, i think "while (new_num<old_num+ 3)" is better.Some time ago, the following patch insert this loop.
http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTi%3Dg%3DojJu0m%2B556rnekYenRTXtX%2BVBOj%3DrPmnjSw%40mail.gmail.com&forum_name=ltp-list
Quoted 9 lines
Quoted 3 lines
The changelog of this patch said "we should wait 3~5 increments of the
/sys/kernel/mm/ksm/full_scansbefore checking ksm* testcases's results", but it do "while (new_num<old_num* 3)" actually.I made a mistake. The code is what I wanted to do, but the changelog was wrong. When testing the new ksm patch, the developer told us we must wait 3~5 times increments of the number before checking testing results. So I coded to wait til
new_num>=old_num* 3 before checking the results.
The bigger old_new is, the longer time test takes, it's strange.
Quoted 5 lines
About 'echo 2 >
/sys/kernel/mm/ksm/run' problem, I have tested it with ksm01.
If I run the 'echo 2 >/sys/kernel/mm/ksm/run' before issue ksm test, the content of/sys/kernel/mm/ksm/runwill be changed to 1 and the test can finished successfully.
I think we shoud not care this.
Quoted 4 lines
Only if I echo the 2 between the testing process,
ksm01 will hang up. On that time,new_numwill be zero, so your plus 3 method won't work either. So what should we do in this circumstance?
Please look at my patch, after stopping ksmd in the testing(echo 2 > /sys/kernel/mm/ksm/run or echo 0 > /sys/kernel/mm/ksm/run), group_check will skip waiting at the loop "new_num >= old_num * 3".
Regards
Bian
Quoted 185 lines
Thanks.
Han Pingtian
Quoted 181 lines
Regards
BianQuoted 167 lines
CAI Qian
Quoted 164 lines
Quoted 4 lines
Quoted 3 lines
2. The condition "
new_num<old_num* 3" seems uncomfortable, i think
it should be "new_num<old_num+ 3"I don't understand. What error did you see from the testing output?
Sometimes, the
old_numis a big number, so it takes long time in this loop,
i don't understand the purpose.
Would you explain to me why we expect this condition "new_num<old_num* 3".Quoted 5 lines
Quoted 3 lines
3. After stopping ksm(echo 2 >
/sys/kernel/mm/ksm/run), the ksmd will stop scaning pages, so looping in "new_num<old_num* 3" is wrong.Ditto.
After stopping ksm, looping in "
new_num<old_num* 3" will make the process hang up,
becausenew_numdoes not be increased.Regards
BianQuoted 115 lines
CAI Qian
Quoted 114 lines
Signed-off-by Bian Naimeng <[email protected]>---
testcases/kernel/mem/include/mem.h| 2 +-testcases/kernel/mem/lib/mem.c| 19 ++++++++++---------2 files changed, 11 insertions(+), 10 deletions(-)testcases/kernel/mem/include/mem.h +1
-1@@ -42,7 +42,7 @@ void check(char *path, long int value);void verify (char value,int proc,int start,int end,int start2,int end2);void group_check (int run,int pages_shared,int pages_sharing,int pages_volatile,int pages_unshared,int sleep_millisecs, -int pages_to_scan); +int pages_to_scan,int scans);void create_same_memory (int size,int num,int unit);void check_ksm_options (int *size,int *num,int *unit);void
write_cpusets(void);testcases/kernel/mem/lib/mem.c +1
-1@@ -284,7 +284,7 @@ void check(char *path, long int value)tst_resm (TINFO ,"%s is %ld." , path,atol (buf));if (atol (buf) != value) -tst_resm (TFAIL ,"%s is not %ld." , path, value); +tst_brkm (TFAIL , tst_exit,"%s is not %ld." , path, value); } void verify(char value, int proc, int start, int end, int start2,int end2)
testcases/kernel/mem/lib/mem.c +2
-1@@ -312,7 +312,8 @@ void verify(char value, int proc, int start, int end, int start2, int end2) void group_check(int run, int pages_shared, int pages_sharing, int pages_volatile, int pages_unshared, - int sleep_millisecs, int pages_to_scan) + int sleep_millisecs, int pages_to_scan, + int scans) { int fd;char buf[BUFSIZ];testcases/kernel/mem/lib/mem.c +1
-1@@ -332,7 +333,7 @@ void group_check(int run, int pages_shared, int pages_sharing, old_num = new_num =atoi (buf);if (lseek (fd,0 ,SEEK_SET ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"lseek" ); -while (new_num < old_num *3 ) { +while (new_num < old_num + scans) {sleep (1 );if (read (fd, buf,BUFSIZ ) <0 )tst_brkm(TBROK|TERRNO, cleanup, "read");testcases/kernel/mem/lib/mem.c +1
-1@@ -587,7 +588,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -599,7 +600,7 @@ void create_same_memory(int size, int num, int unit) tst_resm(TINFO, "resume child 1.");if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -613,7 +614,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for all children to stop."); for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +1
-1@@ -627,7 +628,7 @@ void create_same_memory(int size, int num, int unit) tst_resm(TINFO, "resume child 1.");if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -647,7 +648,7 @@ void create_same_memory(int size, int num, int unit) tst_brkm(TBROK|TERRNO, cleanup, "open");if (write (fd,"2" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" ); -group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );Quoted 16 lines
Quoted 11 lines
testcases/kernel/mem/lib/mem.c +0
-0tst_resm (TINFO ,"wait for all children to stop." );for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +1
-1@@ -668,7 +669,7 @@ void create_same_memory(int size, int num, int unit)if (write (fd,"0" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" );close (fd); -group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );while (waitpid (-1 , &status,WUNTRACED |WCONTINUED ) >0 )if (WEXITSTATUS (status) !=0 )Quoted 5 lines
tst_resm(TFAIL, "child exit status is %d",
--
1.7.1------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 42 lines · Bian Naimeng
Quoted 39 lines · Han Pingtian
Quoted 38 lines · Bian Naimeng
Quoted 18 lines · CAI Qian
----- Original Message -----
Quoted 17 lines
Quoted 10 lines · Qian Cai
Quoted 3 lines · Bian Naimeng
There are some problem in ksm tests.
1. We should break the test when checking is failure.
No, this is not the intention. The design here is to run all tests to check for all stats to give a full picture even if the a single failure has been observed. This type of the failures do not prevent the rest of the tests from running, so there is no need to stop the tests now which also give more insight to track down root causes.
Various reason can make checking failure, someone can make the test hangup.
I did this test on RHEL5, i found ksmd stopped before doing "echo 2 >/sys/kernel/mm/ksm/run",
sogroup_checkwill be hanged on "new_num<old_num* 3".Quoted 6 lines
Quoted 1 line
So, i think we should break the test if "run" is not expecting.
What happened if you run the tests for a recent upstream kernel? There are some patches for ksm recently merged upstream. If the problem still persistent, please paste the EXACT OUTPUT from the ksm01 test. If it is hung, please upload sysrq-t output somewhere.
Maybe there are some bugs in the RHEL6's kernel, but the purpose of this patch is not to workround these bugs, i want to fix the test's bug.
Would you explain to me why we do this loop "while (
new_num<old_num* 3)" ingroup_check, i think "while (new_num<old_num+ 3)" is better.Some time ago, the following patch insert this loop.
http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTi%3Dg%3DojJu0m%2B556rnekYenRTXtX%2BVBOj%3DrPmnjSw%40mail.gmail.com&forum_name=ltp-listThe changelog of this patch said "we should wait 3~5 increments of the
/sys/kernel/mm/ksm/full_scansbefore checking ksm* testcases's results", but it do "while (new_num<old_num* 3)" actually.
Quoted 8 lines
Quoted 6 lines
I made a mistake. The code is what I wanted to do, but the changelog was wrong. When testing the new ksm patch, the developer told us we must wait 3~5 times increments of the number before checking testing results. So I coded to wait til
new_num>=old_num* 3 before checking the results.The bigger
old_newis, the longer time test takes, it's strange.
I agree that it's strange. But it seems that we have to do this way.
Quoted 8 lines
Quoted 6 lines
About 'echo 2 >
/sys/kernel/mm/ksm/run' problem, I have tested it with ksm01.
If I run the 'echo 2 >/sys/kernel/mm/ksm/run' before issue ksm test, the content of/sys/kernel/mm/ksm/runwill be changed to 1 and the test can finished successfully.I think we shoud not care this.
Yep, I think so.
Quoted 9 lines
Quoted 5 lines
Only if I echo the 2 between the testing process,
ksm01 will hang up. On that time,new_numwill be zero, so your plus 3 method won't work either. So what should we do in this circumstance?Please look at my patch, after stopping ksmd in the testing(echo 2 >
/sys/kernel/mm/ksm/runor echo 0 >/sys/kernel/mm/ksm/run),group_checkwill skip waiting at the loop "new_num>=old_num* 3".
Run 'echo 2 > /sys/kernel/mm/ksm/run' before calling group_check() won't cause the while loops infinitely, because old_num and new_num would be all zero before the while, so new_num == old_num * 3, the while won't be ran.
Quoted 200 lines
Regards
BianQuoted 185 lines
Thanks.
Han Pingtian
Quoted 181 lines
Regards
BianQuoted 167 lines
CAI Qian
Quoted 164 lines
Quoted 4 lines
Quoted 3 lines
2. The condition "
new_num<old_num* 3" seems uncomfortable, i think
it should be "new_num<old_num+ 3"I don't understand. What error did you see from the testing output?
Sometimes, the
old_numis a big number, so it takes long time in this loop,
i don't understand the purpose.
Would you explain to me why we expect this condition "new_num<old_num* 3".Quoted 5 lines
Quoted 3 lines
3. After stopping ksm(echo 2 >
/sys/kernel/mm/ksm/run), the ksmd will stop scaning pages, so looping in "new_num<old_num* 3" is wrong.Ditto.
After stopping ksm, looping in "
new_num<old_num* 3" will make the process hang up,
becausenew_numdoes not be increased.Regards
BianQuoted 115 lines
CAI Qian
Quoted 114 lines
Signed-off-by Bian Naimeng <[email protected]>---
testcases/kernel/mem/include/mem.h| 2 +-testcases/kernel/mem/lib/mem.c| 19 ++++++++++---------2 files changed, 11 insertions(+), 10 deletions(-)testcases/kernel/mem/include/mem.h +1
-1@@ -42,7 +42,7 @@ void check(char *path, long int value);void verify (char value,int proc,int start,int end,int start2,int end2);void group_check (int run,int pages_shared,int pages_sharing,int pages_volatile,int pages_unshared,int sleep_millisecs, -int pages_to_scan); +int pages_to_scan,int scans);void create_same_memory (int size,int num,int unit);void check_ksm_options (int *size,int *num,int *unit);void
write_cpusets(void);testcases/kernel/mem/lib/mem.c +1
-1@@ -284,7 +284,7 @@ void check(char *path, long int value)tst_resm (TINFO ,"%s is %ld." , path,atol (buf));if (atol (buf) != value) -tst_resm (TFAIL ,"%s is not %ld." , path, value); +tst_brkm (TFAIL , tst_exit,"%s is not %ld." , path, value); } void verify(char value, int proc, int start, int end, int start2,int end2)
testcases/kernel/mem/lib/mem.c +2
-1@@ -312,7 +312,8 @@ void verify(char value, int proc, int start, int end, int start2, int end2) void group_check(int run, int pages_shared, int pages_sharing, int pages_volatile, int pages_unshared, - int sleep_millisecs, int pages_to_scan) + int sleep_millisecs, int pages_to_scan, + int scans) { int fd;char buf[BUFSIZ];testcases/kernel/mem/lib/mem.c +1
-1@@ -332,7 +333,7 @@ void group_check(int run, int pages_shared, int pages_sharing, old_num = new_num =atoi (buf);if (lseek (fd,0 ,SEEK_SET ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"lseek" ); -while (new_num < old_num *3 ) { +while (new_num < old_num + scans) {sleep (1 );if (read (fd, buf,BUFSIZ ) <0 )tst_brkm(TBROK|TERRNO, cleanup, "read");testcases/kernel/mem/lib/mem.c +1
-1@@ -587,7 +588,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,2 , size * num *256 -2 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -599,7 +600,7 @@ void create_same_memory(int size, int num, int unit) tst_resm(TINFO, "resume child 1.");if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,3 , size * num *256 -3 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -613,7 +614,7 @@ void create_same_memory(int size, int num, int unit)if (kill (child[k],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill child[%d]" , k); } -group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -1 ,0 ,0 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for all children to stop."); for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +1
-1@@ -627,7 +628,7 @@ void create_same_memory(int size, int num, int unit) tst_resm(TINFO, "resume child 1.");if (kill (child[1 ],SIGCONT ) ==-1 )tst_brkm (TBROK |TERRNO , cleanup,"kill" ); -group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num); +group_check (1 ,1 , size * num *256 -2 ,0 ,1 ,0 , size *256 * num,3 );tst_resm(TINFO, "wait for child 1 to stop."); if (waitpid(child[1], &status, WUNTRACED) == -1)testcases/kernel/mem/lib/mem.c +1
-1@@ -647,7 +648,7 @@ void create_same_memory(int size, int num, int unit) tst_brkm(TBROK|TERRNO, cleanup, "open");if (write (fd,"2" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" ); -group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (2 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );Quoted 16 lines
Quoted 11 lines
testcases/kernel/mem/lib/mem.c +0
-0tst_resm (TINFO ,"wait for all children to stop." );for (k = 0; k < num; k++) {testcases/kernel/mem/lib/mem.c +1
-1@@ -668,7 +669,7 @@ void create_same_memory(int size, int num, int unit)if (write (fd,"0" ,1 ) !=1 )tst_brkm (TBROK |TERRNO , cleanup,"write" );close (fd); -group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num); +group_check (0 ,0 ,0 ,0 ,0 ,0 , size *256 * num,0 );while (waitpid (-1 , &status,WUNTRACED |WCONTINUED ) >0 )if (WEXITSTATUS (status) !=0 )Quoted 5 lines
tst_resm(TFAIL, "child exit status is %d",
--
1.7.1------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Signature · 16 lines
Han Pingtian Quality Engineer hpt @ #kernel-qe Red Hat, Inc Freedom ... courage ... Commitment ... ACCOUNTABILITY ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi Bian, to make a conclusion for this thread:
I have tested ksm cases and Pingtian's patch for many times, it worked well. If it doesn't work on your system, please check:
1) Have you disabled ksm and ksmtuned before test? it will very easy to get "stopped before echo 2 > ksm/run" due to ksmtuned behavior if you keep them running.
2) Have you tried with a kernel containing this upstream commit:2919bfd0758257c469abef8c26c3e516bbebb851 ? Without the patch in this commit, your test might fail as well.
Thanks,
Caspar
Quoted 67 lines · Han Pingtian
Quoted 42 lines · Bian Naimeng
Quoted 39 lines · Han Pingtian
Quoted 38 lines · Bian Naimeng
Quoted 18 lines · CAI Qian
----- Original Message -----
Quoted 17 lines
Quoted 10 lines · Qian Cai
Quoted 3 lines · Bian Naimeng
There are some problem in ksm tests.
1. We should break the test when checking is failure.
No, this is not the intention. The design here is to run all tests to check for all stats to give a full picture even if the a single failure has been observed. This type of the failures do not prevent the rest of the tests from running, so there is no need to stop the tests now which also give more insight to track down root causes.
Various reason can make checking failure, someone can make the test hangup.
I did this test on RHEL5, i found ksmd stopped before doing "echo 2 >/sys/kernel/mm/ksm/run",
sogroup_checkwill be hanged on "new_num<old_num* 3".Quoted 6 lines
Quoted 1 line
So, i think we should break the test if "run" is not expecting.
What happened if you run the tests for a recent upstream kernel? There are some patches for ksm recently merged upstream. If the problem still persistent, please paste the EXACT OUTPUT from the ksm01 test. If it is hung, please upload sysrq-t output somewhere.
Maybe there are some bugs in the RHEL6's kernel, but the purpose of this patch is not to workround these bugs, i want to fix the test's bug.
Would you explain to me why we do this loop "while (
new_num<old_num* 3)" ingroup_check, i think "while (new_num<old_num+ 3)" is better.Some time ago, the following patch insert this loop.
http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTi%3Dg%3DojJu0m%2B556rnekYenRTXtX%2BVBOj%3DrPmnjSw%40mail.gmail.com&forum_name=ltp-listThe changelog of this patch said "we should wait 3~5 increments of the
/sys/kernel/mm/ksm/full_scansbefore checking ksm* testcases's results", but it do "while (new_num<old_num* 3)" actually.Quoted 8 lines
Quoted 6 lines
I made a mistake. The code is what I wanted to do, but the changelog was wrong. When testing the new ksm patch, the developer told us we must wait 3~5 times increments of the number before checking testing results. So I coded to wait til
new_num>=old_num* 3 before checking the results.The bigger
old_newis, the longer time test takes, it's strange.I agree that it's strange. But it seems that we have to do this way.
Quoted 8 lines
Quoted 6 lines
About 'echo 2 >
/sys/kernel/mm/ksm/run' problem, I have tested it with ksm01.
If I run the 'echo 2 >/sys/kernel/mm/ksm/run' before issue ksm test, the content of/sys/kernel/mm/ksm/runwill be changed to 1 and the test can finished successfully.I think we shoud not care this.
Yep, I think so.
Quoted 6 lines
Quoted 5 lines
Only if I echo the 2 between the testing process,
ksm01 will hang up. On that time,new_numwill be zero, so your plus 3 method won't work either. So what should we do in this circumstance?
Quoted 39 lines
Quoted 3 lines
Please look at my patch, after stopping ksmd in the testing(echo 2 >
/sys/kernel/mm/ksm/runor echo 0 >/sys/kernel/mm/ksm/run),group_checkwill skip waiting at the loop "new_num>=old_num* 3".Run 'echo 2 >
/sys/kernel/mm/ksm/run' before callinggroup_check()won't cause the while loops infinitely, becauseold_numandnew_numwould be all zero before the while, sonew_num==old_num* 3, the while won't be ran.Quoted 32 lines
Regards
BianQuoted 29 lines
Thanks.
Han Pingtian
Quoted 26 lines
Regards
BianQuoted 23 lines
CAI Qian
Quoted 21 lines
Quoted 4 lines
Quoted 3 lines
2. The condition "
new_num<old_num* 3" seems uncomfortable, i think
it should be "new_num<old_num+ 3"I don't understand. What error did you see from the testing output?
Sometimes, the
old_numis a big number, so it takes long time in this loop,
i don't understand the purpose.
Would you explain to me why we expect this condition "new_num<old_num* 3".Quoted 5 lines
Quoted 3 lines
3. After stopping ksm(echo 2 >
/sys/kernel/mm/ksm/run), the ksmd will stop scaning pages, so looping in "new_num<old_num* 3" is wrong.Ditto.
After stopping ksm, looping in "
new_num<old_num* 3" will make the process hang up,
becausenew_numdoes not be increased.Regards
Bian
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list