Updated Branches: refs/heads/master f714d2603 -> 723a45573
CLOUDSTACK-2434: Enabling irqbalance only on router having mutiple virtual processors Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/723a4557 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/723a4557 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/723a4557 Branch: refs/heads/master Commit: 723a45573123c43b9d3ecdd2b48f8911e83b8a93 Parents: f714d26 Author: Abhinandan Prateek <aprat...@apache.org> Authored: Mon Jun 3 13:46:43 2013 +0530 Committer: Abhinandan Prateek <aprat...@apache.org> Committed: Mon Jun 3 13:46:43 2013 +0530 ---------------------------------------------------------------------- .../debian/config/etc/init.d/cloud-early-config | 25 ++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/723a4557/patches/systemvm/debian/config/etc/init.d/cloud-early-config ---------------------------------------------------------------------- diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index 7be8663..082d975 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash ### BEGIN INIT INFO # Provides: cloud-early-config # Required-Start: mountkernfs $local_fs @@ -342,6 +342,22 @@ enable_svc() { [ -f $cfg ] && sed -i "s/ENABLED=.*$/ENABLED=$enabled/" $cfg && return } + +enable_irqbalance() { + local enabled=$1 + local proc=0 + + $proc = $(cat /proc/cpuinfo | grep "processor" | wc -l) + if [ $proc -le 1 ] && [ $enabled -eq 1 ] + then + enabled = 0 + fi + + log_it "Processors = $proc Enable service ${svc} = $enabled" + local cfg=/etc/default/irqbalance + [ -f $cfg ] && sed -i "s/ENABLED=.*$/ENABLED=$enabled/" $cfg && return +} + disable_hvc() { [ ! -d /proc/xen ] && sed -i 's/^vc/#vc/' /etc/inittab && telinit q [ -d /proc/xen ] && sed -i 's/^#vc/vc/' /etc/inittab && telinit q @@ -698,6 +714,7 @@ setup_router() { enable_svc dnsmasq 1 enable_svc haproxy 1 + enable_irqbalance 1 enable_svc cloud-passwd-srvr 1 enable_svc cloud 0 disable_rpfilter_domR @@ -777,6 +794,7 @@ EOF enable_svc dnsmasq 1 enable_svc haproxy 1 + enable_irqbalance 1 enable_svc cloud 0 disable_rpfilter enable_fwding 1 @@ -803,6 +821,7 @@ setup_dhcpsrvr() { enable_svc dnsmasq 1 enable_svc haproxy 0 + enable_irqbalance 0 enable_svc cloud-passwd-srvr 1 enable_svc cloud 0 enable_fwding 0 @@ -855,6 +874,7 @@ setup_secstorage() { disable_rpfilter enable_fwding 0 enable_svc haproxy 0 + enable_irqbalance 0 enable_svc dnsmasq 0 enable_svc cloud-passwd-srvr 0 enable_svc cloud 1 @@ -879,6 +899,7 @@ setup_console_proxy() { disable_rpfilter enable_fwding 0 enable_svc haproxy 0 + enable_irqbalance 0 enable_svc dnsmasq 0 enable_svc cloud-passwd-srvr 0 enable_svc cloud 1 @@ -905,6 +926,7 @@ setup_elbvm() { enable_fwding 0 enable_svc haproxy 0 + enable_irqbalance 0 enable_svc dnsmasq 0 enable_svc cloud-passwd-srvr 0 enable_svc cloud 0 @@ -927,6 +949,7 @@ setup_ilbvm() { enable_fwding 0 enable_svc haproxy 1 + enable_irqbalance 1 enable_svc dnsmasq 0 enable_svc cloud-passwd-srvr 0 enable_svc cloud 0