Re: CFS Bandwidth Control - Test results of cgroups tasks pinned vsunpinnede

From: Peter Zijlstra
Date: Tue Sep 20 2011 - 08:55:53 EST


On Thu, 2011-09-15 at 23:25 +0530, Kamalesh Babulal wrote:

> lb.sh
> ------
> #!/bin/bash
>
> rm -rf test*
> rm -rf t*

You're insane, right?

> ITERATIONS=60 # No of Iterations to capture the details
> NUM_CPUS=$(cat /proc/cpuinfo |grep -i proces|wc -l)
>
> NUM_HOGS=$((NUM_CPUS * 2)) # No of hogs threads to invoke
>
> echo "System has $NUM_CPUS cpus..... Spawing $NUM_HOGS cpu hogs ... for $ITERATIONS seconds.."
> if [ ! -e while1.c ]
> then
> cat >> while1.c << EOF
> int
> main (int argc, char **argv)
> {
> while(1);
> return (0);
> }
> EOF
> fi
>
> for i in $(seq 1 $NUM_HOGS)
> do
> gcc -o while$i while1.c
> if [ $? -ne 0 ]
> then
> echo "Looks like gcc is not present ... aborting"
> exit
> fi
> done
>
> for i in $(seq 1 $NUM_HOGS)
> do
> ./while$i &

You can kill the above two blocks by doing:

while :; do :; done &

> pids[$i]=$!
> pids_old[$i]=`cat /proc/$!/sched |grep -i nr_migr|grep -iv cold|cut -d ":" -f2|sed 's/ //g'`
> done


and a fixup of the pkill muck.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/