This patch adds the code to do the setup for a default group which will be
spinning a task to create an ideal scenario for group fairness.
Signed-off-by: Sudhir Kumar <[EMAIL PROTECTED]>
Index: ltp-full-20081031/testcases/kernel/controllers/cpuctl/parameters.sh
===================================================================
--- ltp-full-20081031.orig/testcases/kernel/controllers/cpuctl/parameters.sh
+++ ltp-full-20081031/testcases/kernel/controllers/cpuctl/parameters.sh
@@ -41,6 +41,24 @@
#################################################################################
+set_def_group() #default group spinning a task to create ideal scenario
+{
+ [ -d /dev/cpuctl/group_def ] || mkdir /dev/cpuctl/group_def;
+ if [ $? -ne 0 ]
+ then
+ echo "ERROR: Can't create default group... "
+ "Check your permissions..Exiting test";
+ cleanup;
+ exit -1;
+ fi
+ # Migrate all the running tasks to this group
+ # rt tasks require a finite value to cpu.rt_runtime_us
+ echo 10000 > /dev/cpuctl/group_def/cpu.rt_runtime_us;
+ for task in `cat /dev/cpuctl/tasks`; do
+ echo $task > /dev/cpuctl/group_def/tasks 2>/dev/null 1>&2;
+ done
+}
+
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
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list