1Testcase 01 2----------- 3 4This test attempts to verify that when a CPU is offlined, that a process 5writing to disk doesn't cause an issue. We create a process that writes 6to disk, force it to run only on a specified CPU by setting its CPU 7affinity to just that CPU, then offline that CPU, and verify that the 8process moves to another processor properly. 9 10 11Notes 12===== 13 14There are two kinds of masks: One to specify which CPU's are allowed 15to be used for the given process, and one for the smp affinity. 16 17This may be hard to verify but we can indirectly check on this 18by looking at /proc/stat or measuring the relative performance 19of some parallelized benchmark before and after onlining the CPU. 20 21 22Algorithm 23========= 24Given a CPU to test that exists 25 26Take a snapshot of what CPUs are on and off initially 27 28Make sure the cpu is online 29 30Start up a process that writes to disk 31 32Loop until done: 33 Take a snapshot of /proc/interrupts 34 35 Foreach CPU in the system 36 online the CPU 37 migrate the IRQs to it 38 sleep a little while 39 40 Foreach CPU in the system 41 migrate IRQs onto the CPU 42 offline the cpu 43 sleep a little while 44 45 Take another snapshot of /proc/interrupts 46 47 Print a report showing the change in IRQs 48 49 50When exiting: 51 Kill the write loop process 52 53 Restore all CPUs to their initial state 54