All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [LTP] [PATCH] Use a saner variant for computing the number of groups in cpuctl tests
       [not found] <200910301656.n9UGuui3018802@e1.ny.us.ibm.com>
@ 2009-11-02 13:59 ` Subrata Modak
  0 siblings, 0 replies; 2+ messages in thread
From: Subrata Modak @ 2009-11-02 13:59 UTC (permalink / raw)
  To: Jiri Palecek; +Cc: ltp-list

Thanks.

Regards--
Subrata

On Wed, 2009-10-21 at 13:36 +0200, Jiri Palecek wrote: 
> Hello,
> 
> this patch changes the calculation of numer of groups in cpuctl test.
> 
> The new code doesn't need bc, and is more comprehensible IMHO
> 
> Regards
>     Jiri Palecek
> 
> ---
>  testcases/kernel/controllers/cpuctl/parameters.sh |   11 +----------
>  1 files changed, 1 insertions(+), 10 deletions(-)
> 
> diff --git a/testcases/kernel/controllers/cpuctl/parameters.sh b/testcases/kernel/controllers/cpuctl/parameters.sh
> index a23dbe5..502944e 100755
> --- a/testcases/kernel/controllers/cpuctl/parameters.sh
> +++ b/testcases/kernel/controllers/cpuctl/parameters.sh
> @@ -61,16 +61,7 @@ set_def_group() #default group spinning a task to create ideal scenario
> 
>  get_num_groups()        # Number of tasks should be >= number of cpu's (to check scheduling fairness)
>  {
> -        num_grps=$(echo "$NUM_CPUS * 1.5"|bc)   # temp variable num_grps
> -        int_part=`echo $num_grps | cut -d"." -f1`
> -        dec_part=`echo $num_grps | cut -d"." -f2`
> -
> -        if [ $dec_part -gt 0 ]
> -        then
> -                NUM_GROUPS=$(echo "$int_part + 1"|bc)
> -        else
> -                NUM_GROUPS=$int_part;
> -        fi
> +        NUM_GROUPS=$(( (NUM_CPUS*3 + 1)/2 ))
>  }
> 
>  	# Write the cleanup function


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* [LTP] [PATCH] Use a saner variant for computing the number of groups in cpuctl tests
@ 2009-10-21 11:36 Jiri Palecek
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Palecek @ 2009-10-21 11:36 UTC (permalink / raw)
  Cc: ltp-list

Hello,

this patch changes the calculation of numer of groups in cpuctl test.

The new code doesn't need bc, and is more comprehensible IMHO

Regards
    Jiri Palecek

---
 testcases/kernel/controllers/cpuctl/parameters.sh |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/testcases/kernel/controllers/cpuctl/parameters.sh b/testcases/kernel/controllers/cpuctl/parameters.sh
index a23dbe5..502944e 100755
--- a/testcases/kernel/controllers/cpuctl/parameters.sh
+++ b/testcases/kernel/controllers/cpuctl/parameters.sh
@@ -61,16 +61,7 @@ set_def_group() #default group spinning a task to create ideal scenario
 
 get_num_groups()        # Number of tasks should be >= number of cpu's (to check scheduling fairness)
 {
-        num_grps=$(echo "$NUM_CPUS * 1.5"|bc)   # temp variable num_grps
-        int_part=`echo $num_grps | cut -d"." -f1`
-        dec_part=`echo $num_grps | cut -d"." -f2`
-
-        if [ $dec_part -gt 0 ]
-        then
-                NUM_GROUPS=$(echo "$int_part + 1"|bc)
-        else
-                NUM_GROUPS=$int_part;
-        fi
+        NUM_GROUPS=$(( (NUM_CPUS*3 + 1)/2 ))
 }
 
 	# Write the cleanup function
-- 
1.6.4.3




------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2009-11-02 13:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200910301656.n9UGuui3018802@e1.ny.us.ibm.com>
2009-11-02 13:59 ` [LTP] [PATCH] Use a saner variant for computing the number of groups in cpuctl tests Subrata Modak
2009-10-21 11:36 Jiri Palecek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.