public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* Re: [LTP] Fix the test04 of testcases/kernel/numa/numa01.sh
@ 2011-01-17  0:38 Kazuki Seki
  2011-01-19  9:37 ` Garrett Cooper
  0 siblings, 1 reply; 7+ messages in thread
From: Kazuki Seki @ 2011-01-17  0:38 UTC (permalink / raw)
  To: ltp-list; +Cc: 関 和輝

Hi,

Did you confirm the following email which I posted before?

Best regards,
K Seki

----- Original Message ----- 
From: "Kazuki Seki" <k-seki@np.css.fujitsu.com>
To: <ltp-list@lists.sourceforge.net>
Cc: "Kazuki Seki" <k-seki@np.css.fujitsu.com>
Sent: Monday, December 13, 2010 3:51 PM
Subject: Fix the test04 of testcases/kernel/numa/numa01.sh

> Hi,
>
> I found the test04 of testcases/kernel/numa/numa01.sh can become either
> PASS or FAIL on the same system.
> As a result of examining the following lines of the shell,
> I noticed the execution way of these processings is wrong.
>
>  - Here is a part of a problem in the shell.
>  ---------------------------------------------------------------------------
>   numactl --physcpubind=$run_on_cpu support_numa $PAUSE & #just waits for
> sigint
>   pid=$!
>   running_on_cpu=$(awk '{ print $39; }' /proc/$pid/stat)
>  ---------------------------------------------------------------------------
>
> The following shows the root cause:
>
>  (A) : numactl --physcpubind=$run_on_cpu support_numa $PAUSE &
>  (B) : running_on_cpu=$(awk '{ print $39; }' /proc/$pid/stat)
>
> If (B) completes its execution before (A) binds a certain CPU,
> (B) doesn't set the number of expected CPU and then the test becomes FAIL.
> Therefore, (B) must start after (A) binds a certain CPU.
>
> I made the patch which executes (B) after cmm field of /proc/$pid/stat
> changes from "(numactl)" into "(support_numa)".
>
>  - Example of changing cmm field of /proc/$pid/stat
>  ---------------------------------------------------------------------------
>    [before (A) binds CPU]
>     # awk '{ print $2; }' /proc/$pid/stat
>       (numactl)
>       ^^^^^^^^^
>       cmm field
>
>    [after (A) bound CPU]
>     # awk '{ print $2; }' /proc/$pid/stat
>       (support_numa)
>  ---------------------------------------------------------------------------
>
> Please apply this patch.
>
> ---
> testcases/kernel/numa/numa01.sh |    4 ++++
> 1 file changed, 4 insertions(+)
>
> Index: ltp-70a3216/testcases/kernel/numa/numa01.sh
> ===================================================================
> --- ltp-70a3216.orig/testcases/kernel/numa/numa01.sh    2010-12-01
> 10:50:43.000000000 +0900
> +++ ltp-70a3216/testcases/kernel/numa/numa01.sh 2010-12-01
> 10:51:55.000000000 +0900
> @@ -471,6 +471,10 @@ test04()
>     run_on_cpu=$[$[$no_of_cpus+1]/2]
>     numactl --physcpubind=$run_on_cpu support_numa $PAUSE & #just waits 
> for
> sigint
>     pid=$!
> +    var=`awk '{ print $2; }' /proc/$pid/stat`
> +    while [ $var == "(numactl)" ];do
> +        var=`awk '{ print $2; }' /proc/$pid/stat`
> +    done
>     # Warning !! 39 represents cpu number, on which process pid is
> currently running and
>     # this may change if Some more fields are added in the middle, may be
> in future
>     running_on_cpu=$(awk '{ print $39; }' /proc/$pid/stat)
>
> Best regards,
> K Seki



------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [LTP] Fix the test04 of testcases/kernel/numa/numa01.sh
@ 2010-12-13  6:51 関 和輝
  2011-01-24  4:21 ` Garrett Cooper
  0 siblings, 1 reply; 7+ messages in thread
From: 関 和輝 @ 2010-12-13  6:51 UTC (permalink / raw)
  To: ltp-list; +Cc: 関 和輝

Hi,

I found the test04 of testcases/kernel/numa/numa01.sh can become either
PASS or FAIL on the same system.
As a result of examining the following lines of the shell,
I noticed the execution way of these processings is wrong.

  - Here is a part of a problem in the shell.
  ---------------------------------------------------------------------------
   numactl --physcpubind=$run_on_cpu support_numa $PAUSE & #just waits for 
sigint
   pid=$!
   running_on_cpu=$(awk '{ print $39; }' /proc/$pid/stat)
  ---------------------------------------------------------------------------

The following shows the root cause:

  (A) : numactl --physcpubind=$run_on_cpu support_numa $PAUSE &
  (B) : running_on_cpu=$(awk '{ print $39; }' /proc/$pid/stat)

If (B) completes its execution before (A) binds a certain CPU,
(B) doesn't set the number of expected CPU and then the test becomes FAIL.
Therefore, (B) must start after (A) binds a certain CPU.

I made the patch which executes (B) after cmm field of /proc/$pid/stat
changes from "(numactl)" into "(support_numa)".

  - Example of changing cmm field of /proc/$pid/stat
  ---------------------------------------------------------------------------
    [before (A) binds CPU]
     # awk '{ print $2; }' /proc/$pid/stat
       (numactl)
       ^^^^^^^^^
       cmm field

    [after (A) bound CPU]
     # awk '{ print $2; }' /proc/$pid/stat
       (support_numa)
  ---------------------------------------------------------------------------

Please apply this patch.

---
 testcases/kernel/numa/numa01.sh |    4 ++++
 1 file changed, 4 insertions(+)

Index: ltp-70a3216/testcases/kernel/numa/numa01.sh
===================================================================
--- ltp-70a3216.orig/testcases/kernel/numa/numa01.sh    2010-12-01 
10:50:43.000000000 +0900
+++ ltp-70a3216/testcases/kernel/numa/numa01.sh 2010-12-01 
10:51:55.000000000 +0900
@@ -471,6 +471,10 @@ test04()
     run_on_cpu=$[$[$no_of_cpus+1]/2]
     numactl --physcpubind=$run_on_cpu support_numa $PAUSE & #just waits for 
sigint
     pid=$!
+    var=`awk '{ print $2; }' /proc/$pid/stat`
+    while [ $var == "(numactl)" ];do
+        var=`awk '{ print $2; }' /proc/$pid/stat`
+    done
     # Warning !! 39 represents cpu number, on which process pid is 
currently running and
     # this may change if Some more fields are added in the middle, may be 
in future
     running_on_cpu=$(awk '{ print $39; }' /proc/$pid/stat)

Best regards,
K Seki 



------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-24  4:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-17  0:38 [LTP] Fix the test04 of testcases/kernel/numa/numa01.sh Kazuki Seki
2011-01-19  9:37 ` Garrett Cooper
2011-01-24  2:38   ` Gui Jianfeng
2011-01-24  4:18     ` Garrett Cooper
2011-01-24  4:58       ` Gui Jianfeng
  -- strict thread matches above, loose matches on Subject: below --
2010-12-13  6:51 関 和輝
2011-01-24  4:21 ` Garrett Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox