[Hotplug_sig] Hotplug Testing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 08, 2004 at 11:52:53AM -0600, Joel Schopp wrote:

This is the test i use for regression testing on IPF. I havent read
all the test senarious, but its important to test if irq will migrate to this new
cpu, and also when the cpu will go away, we can handle without loss of work
transparently.

Attached is a simple shell script. The only one that is hard coded is the irq numbers
which can be obtained from /proc/interrupts as well.

SInce IPF we dont support boot cpu removal, (due to restriction with CPEI, btw
this will go away when platforms support ACPI 3.0) the script doesnt really try 
removing cpu0. 

The script is a little flaky, i.e we dont check if current state is offline/online 
etc, it might be better to build those in if we need some robustness.

In addition, i leave some time after an online, before i offline (in parallel
there are ltptest and some make -j running for load) so we let some work be handled
on this cpu as well before offlining. 


hope this helps.

Cheers,
ashok

> > We're planning to test hotplug capability on PowerPC platforms we have
> > in house.  Following this text is a description of the systems. 
> > Basically we have two systems and an HMC.
> > 
> > Also following is a brief conversation I had with Dave Hansen about
> > possible testing we can do, but I'd like this discussion to move to a
> > wider forum.  What suggestions does this group have for our testing
> > hotplug given the equipment we have?
> > 
> 
> Tom, good to run into you again.
> 
> I suggest regression testing cpu hotplug/dlpar on regular builds.  I 
> would be happy to work with whoever is doing this on the osdl end to 
> explain how everything works and develop some tests.  I've attached some 
> tests I had handy.  Most of the other approx dozen I have are pretty 
> hardcoded to our test environment and need to be cleaned up to be useful 
> in other environments.  Not that these are cleaned up either, but they 
> should work.  The tests as written require 4 virtual cpus.  They are 
> also designed to be run in pairs.  They should run on other 
> architectures fine.
> 
> As for memory hotplug on ppc64 even compile and boot testing would be a 
> good start until things restabalize.  The current -mhp tree needs a hack 
> from Mike to even boot properly.  We can then add on incremental tests 
> as they would be useful.

-------------- next part --------------
#!/bin/bash

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.

do_clean()
{
	/bin/rm -rf $TMP_FILE
}

do_intr()
{
	echo "Cleaning up... user interrupt"
	do_clean
	exit 1
}

trap "do_intr" 1 2 15 

#arg1 = cpu number

migrate_irq()
{
	MASK=$((1<<$1))
	for irq in 45 48 49
	do
		echo $MASK > /proc/irq/$irq/smp_affinity
	done
}

do_offline()
{
	#Migrate some irq's this way first.
	migrate_irq $1
	$TIME echo 0 > /sys/devices/system/cpu/cpu$1/online
	TM=`cat $TMP_FILE`
	echo "Time to Offline cpu $1 : $TM"
}

do_online()
{
	$TIME echo 1 > /sys/devices/system/cpu/cpu$1/online
	TM=`cat $TMP_FILE`
	echo "Time to Online cpu $1 : $TM"
	migrate_irq $1
}

CNT=0
while : 
do
	CNT=$(($CNT+1))
	echo "Loop Count $CNT"
	for cpu in 1 2 3
	do
		do_offline $cpu
		sleep $TM_OFFLINE
	done

	for cpu in 1 2 3
	do
		do_online $cpu
		sleep $TM_ONLINE
	done
	sleep $TM_DLY
done

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux