Generating CPU load and moving load to different CPU cores

I used this to wake some CPU cores which had been sleeping

Start a process

In this example we will use the yes command (which ordinarily prints "yes" to the screen repeatedly)

[robbie@host ~]$ yes > /dev/null &
[1] 76493
Observe current CPU core frequencies
[robbie@ host ~]$ grep MHz /proc/cpuinfo
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 9.808
cpu MHz         : 9.808
cpu MHz         : 55.218
cpu MHz         : 9.808
cpu MHz         : 9.808
cpu MHz         : 55.218
cpu MHz         : 9.808
cpu MHz         : 9.808
cpu MHz         : 9.808
cpu MHz         : 3199.902
cpu MHz         : 3199.902
Move the "yes" process to various cores

A 1 second sleep was required between each move, otherwise the reported core frequency didn't change as the process didn't seem to be scheduled for long enough to wake the core

[robbie@ host ~]$ for i in 7 8 9 10 11 12 13 14 15 16 17 ; do taskset -c -p $i 76493 ; sleep 1 ; done
pid 76493's current affinity list: 19
pid 76493's new affinity list: 7
pid 76493's current affinity list: 7
pid 76493's new affinity list: 8
pid 76493's current affinity list: 8
pid 76493's new affinity list: 9
pid 76493's current affinity list: 9
pid 76493's new affinity list: 10
pid 76493's current affinity list: 10
pid 76493's new affinity list: 11
pid 76493's current affinity list: 11
pid 76493's new affinity list: 12
pid 76493's current affinity list: 12
pid 76493's new affinity list: 13
pid 76493's current affinity list: 13
pid 76493's new affinity list: 14
pid 76493's current affinity list: 14
pid 76493's new affinity list: 15
pid 76493's current affinity list: 15
pid 76493's new affinity list: 16
pid 76493's current affinity list: 16
pid 76493's new affinity list: 17
Check core frequencies again

The cores have all woken up and are reporting the higher frequencies

[robbie@ host ~]$ grep MHz /proc/cpuinfo
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
cpu MHz         : 3199.902
Clean up

Don't forget to kill the CPU intensive process...

[robbie@ host ~]$ kill 76493