From 08e0618fef8173d3c94d64bce69f34d26f6a1f1c Mon Sep 17 00:00:00 2001 From: Pierre Pfister Date: Fri, 4 Nov 2016 15:39:10 +0000 Subject: Adding CPU jitter elimination tricks Change-Id: I70bc1f5cff21ecbba734fa44cd2d94a1e5be8e9a Signed-off-by: Pierre Pfister --- vhost-test/vhost.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'vhost-test') diff --git a/vhost-test/vhost.sh b/vhost-test/vhost.sh index c80e39f..552bdc5 100755 --- a/vhost-test/vhost.sh +++ b/vhost-test/vhost.sh @@ -444,6 +444,8 @@ function start() { touch "$TMP_DIR/.started" + echo "0" | sudo tee /proc/sys/kernel/watchdog_cpumask + start_vpp vmdir_mount @@ -466,6 +468,12 @@ function pin_vm() { } function pin_vpp() { + + for i in $(ls /proc/irq/ | grep [0-9]); do + echo 1 | sudo tee /proc/irq/$i/smp_affinity > /dev/null || true ; + done + + PIDS=$(ps -eLf | grep /bin/vpp | awk '$5 > 50 { print $4; }') idx=0 for p in $PIDS; do @@ -515,6 +523,24 @@ function cmd_pin() { pin } +function cmd_turbo_disable() { + load_config + sudo modprobe msr + echo "Disabling turboboost on CPUs $CORES_VPP_LIST $CORES_VM_LIST" + for cpu in $CORES_VPP_LIST $CORES_VM_LIST ; do + sudo wrmsr -p ${cpu} 0x1a0 0x4000850089 + done +} + +function cmd_turbo_enable() { + load_config + sudo modprobe msr + echo "Enabling turboboost on CPUs $CORES_VPP_LIST $CORES_VM_LIST" + for cpu in $CORES_VPP_LIST $CORES_VM_LIST ; do + sudo wrmsr -p ${cpu} 0x1a0 0x850089 + done +} + function cmd_stop() { load_config stop -- cgit 1.2.3-korg