Add performance optimization to Nested VM 88/3888/2
authorPeter Mikus <pmikus@cisco.com>
Mon, 21 Nov 2016 08:33:33 +0000 (08:33 +0000)
committerPeter Mikus <pmikus@cisco.com>
Mon, 21 Nov 2016 08:35:50 +0000 (08:35 +0000)
- Add isolcpu to grub
- Add SMP affinity pinning into testpmd startup script

Change-Id: I027635f9c27f565e2be10656663463a1b7274afc
Signed-off-by: pmikus <pmikus@cisco.com>
resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support
resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu [new file with mode: 0644]

index 99ac0e1..fb166ef 100755 (executable)
@@ -50,6 +50,11 @@ do
   echo $dev > /sys/bus/pci/drivers/${TARGET_DRIVER}/bind
 done
 
+for i in $(ls /proc/irq/ | grep [0-9])
+do
+  echo 1 > /proc/irq/$i/smp_affinity
+done
+
 # Start testpmd in the background. This looks a bit convoluted; we need to redirect stdin
 # (and keep stdin active) or else testpmd will quit.
 tail -f /dev/null | nohup testpmd $@ > ${TESTPMD_LOG} 2>&1 &
diff --git a/resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu b/resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu
new file mode 100644 (file)
index 0000000..72d9416
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+patch boot/grub/menu.lst <<"_EOF"
+15c17
+<       kernel /boot/bzImage rw root=/dev/sda1 console=ttyS0,115200n8
+---
+>       kernel /boot/bzImage rw root=/dev/sda1 console=ttyS0,115200n8 isolcpus=1-7 nohz_full=1-7 rcu_nocbs=1-7
+_EOF
\ No newline at end of file