lkml.org 
[lkml]   [2011]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: CFS Bandwidth Control - Test results of cgroups tasks pinned vs unpinnede
From
Date
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.


\
 
 \ /
  Last update: 2011-09-20 14:57    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog