Add guest environment setup scripts
[kvmfornfv.git] / ci / envs / guest-setup1.sh
1 #!/bin/bash
2 ##############################################################################
3 ## Copyright (c) 2015 Intel Corp.
4 ##
5 ## All rights reserved. This program and the accompanying materials
6 ## are made available under the terms of the Apache License, Version 2.0
7 ## which accompanies this distribution, and is available at
8 ## http://www.apache.org/licenses/LICENSE-2.0
9 ###############################################################################
10
11 set_irq_affinity () {
12     for irq in /proc/irq/* ; do
13        echo 0 > /proc/irq/${1}/smp_affinity_list
14     done
15 }
16
17 # Disable watchdogs to reduce overhead
18 echo 0 > /proc/sys/kernel/watchdog
19 echo 0 > /proc/sys/kernel/nmi_watchdog
20
21 # Route device interrupts to non-RT CPU
22 set_irq_affinity
23
24 # Disable RT throttling
25 echo -1 > /proc/sys/kernel/sched_rt_period_us
26 echo -1 > /proc/sys/kernel/sched_rt_runtime_us