public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Bian Naimeng <biannm@cn.fujitsu.com>
To: Qian Cai <qcai@redhat.com>
Cc: "ltp-list@lists.sourceforge.net" <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH]KSM: full_scans will stop increasing after	stopping ksm
Date: Wed, 06 Apr 2011 11:56:12 +0800	[thread overview]
Message-ID: <4D9BE45C.8010001@cn.fujitsu.com> (raw)
In-Reply-To: <4D9BC10C.1060406@cn.fujitsu.com>



Bian Naimeng wrote:
> 
> Qian Cai wrote:
>> On 2011-4-4, at 0:47, Bian Naimeng <biannm@cn.fujitsu.com> wrote:
>>
>>> 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

> so group_check will be hanged on "new_num < old_num * 3".
> 
> So, i think we should break the test if "run" is not expecting.
> 
>>> 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_num is 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".
> 
>>> 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,
> because new_num does not be increased.
> 
> Regards
>  Bian
> 
> 
>> CAI Qian
>>> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
>>>
>>> ---
>>> testcases/kernel/mem/include/mem.h |    2 +-
>>> testcases/kernel/mem/lib/mem.c     |   19 ++++++++++---------
>>> 2 files changed, 11 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/testcases/kernel/mem/include/mem.h b/testcases/kernel/mem/include/mem.h
>>> index 778d403..b640a63 100644
>>> --- a/testcases/kernel/mem/include/mem.h
>>> +++ b/testcases/kernel/mem/include/mem.h
>>> @@ -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);
>>> diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
>>> index 12e61e9..db1a7dd 100644
>>> --- a/testcases/kernel/mem/lib/mem.c
>>> +++ b/testcases/kernel/mem/lib/mem.c
>>> @@ -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);
>>>
>>>    tst_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",
>>> -- 
>>> 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
> Ltp-list@lists.sourceforge.net
> 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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

       reply	other threads:[~2011-04-06  3:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4D99771C.4070804@cn.fujitsu.com>
     [not found] ` <F5B7D66E-E830-4D2C-B975-E99A78EF5897@redhat.com>
     [not found]   ` <4D9BC10C.1060406@cn.fujitsu.com>
2011-04-06  3:56     ` Bian Naimeng [this message]
2011-04-06 23:39     ` [LTP] [PATCH]KSM: full_scans will stop increasing after stopping ksm CAI Qian
2011-04-07  5:52       ` Bian Naimeng
2011-04-07  6:32         ` CAI Qian
2011-04-08  3:28         ` Han Pingtian
2011-04-08  5:31           ` Bian Naimeng
2011-04-08  6:07             ` Han Pingtian
2011-05-10 16:06               ` Caspar Zhang

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=4D9BE45C.8010001@cn.fujitsu.com \
    --to=biannm@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=qcai@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox