Ok, how about this, which keeps the same $CPU thingy I added and a command line option for a list of irq's, since that can change? For example: ./do_cpu "1 2 3" On Wed, Dec 08, 2004 at 03:11:40PM -0800, Raj, Ashok wrote: > Getting CPU is fine. Iam going to submit a patch that will not list an > "online" file for cpu0 (if that is not removable), so basically > selecting the ones that have "online" file would probably make sense. > > I don't think the intr part is ok, since /proc/interrupts list even > percpu interrupts, there is nothing to migrate there, the numbers I > picked are the ones that have scsi controller, eth and serial line > irq's, the ones I picked to generate interrupt activity. > > Cheers, > ashok raj > - Open Source Technology Center > > -------------- next part -------------- --- do_cpu.orig 2005-01-04 10:50:53.637229064 -0800 +++ do_cpu 2005-01-04 10:50:30.629726736 -0800 @@ -1,11 +1,15 @@ #!/bin/bash +IRQS_TO_MOVE=$1 + TMP_FILE=/tmp/cpu_$$ TIME="/usr/bin/time -o $TMP_FILE -f \"%e\"" TM_ONLINE=10 # Time delay after an online of cpu TM_OFFLINE=10 # Time delay after offline of cpu TM_DLY=30 # Time delay before start of entire new cycle. +CPUS=`grep processor /proc/cpuinfo | grep -v " 0$" | awk '{print $3}' | xargs` + do_clean() { /bin/rm -rf $TMP_FILE @@ -25,7 +29,7 @@ migrate_irq() { MASK=$((1<<$1)) - for irq in 45 48 49 + for irq in $IRQS_TO_MOVE do echo $MASK > /proc/irq/$irq/smp_affinity done @@ -48,18 +52,20 @@ migrate_irq $1 } +echo "Moving the following IRQs: $IRQS_TO_MOVE" + CNT=0 while : do CNT=$(($CNT+1)) echo "Loop Count $CNT" - for cpu in 1 2 3 + for cpu in $CPUS do do_offline $cpu sleep $TM_OFFLINE done - for cpu in 1 2 3 + for cpu in $CPUS do do_online $cpu sleep $TM_ONLINE