Description: Prevent irqbalance from running on certain platforms On certain platforms like the HP M800 Server cartridge (armhf) running irqbalance could cause significant deterioration of network performance. The patch disables irqbalance from running on such platform. Author: Manoj Iyer Bug: http://bugs.launchpad.net/bugs/1452875 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ Index: irqbalance/irqbalance.c =================================================================== --- irqbalance.orig/irqbalance.c +++ irqbalance/irqbalance.c @@ -49,6 +49,8 @@ int numa_avail; int need_rescan; unsigned int log_mask = TO_ALL; enum hp_e hint_policy = HINT_POLICY_SUBSET; +enum _bool {false = 0, true = 1}; +typedef enum _bool Bool; unsigned long power_thresh = ULONG_MAX; unsigned long long cycle_count = 0; char *pidfile = NULL; @@ -56,6 +58,27 @@ char *banscript = NULL; char *polscript = NULL; long HZ; +Bool disable_on_platform() +{ + char tmp[256] = {0x0}; + char *platform = "HP ProLiant m800 Server Cartridge"; + char *sys_file = "/proc/device-tree/model"; + FILE *fp = fopen(sys_file, "r"); + + while (fp != NULL && fread(tmp, 1, sizeof(tmp), fp) != 0) { + if (strstr(tmp, platform)) { + fclose(fp); + log(TO_ALL, LOG_WARNING, + "Balancing is ineffective on %s.\n", platform); + return true; + } + } + + if (fp != NULL) + fclose(fp); + return false; +} + void sleep_approx(int seconds) { struct timespec ts; @@ -290,6 +313,9 @@ int main(int argc, char** argv) if (debug_mode) dump_object_tree(); + /* On certain platforms prevent irqbalance from running*/ + if (disable_on_platform()) + exit(EXIT_SUCCESS); /* On single core UP systems irqbalance obviously has no work to do */ if (core_count<2) {