From 25610a2e896455e900df902d0c5cd0d5a9824506 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:17:19 +0000 Subject: import irqbalance-1.0.7-6.el7 --- diff --git a/SOURCES/irqbalance-1.0.8-parse-isolcpus-and-nohz-cpus-from-sysfs.patch b/SOURCES/irqbalance-1.0.8-parse-isolcpus-and-nohz-cpus-from-sysfs.patch new file mode 100644 index 0000000..f1d48af --- /dev/null +++ b/SOURCES/irqbalance-1.0.8-parse-isolcpus-and-nohz-cpus-from-sysfs.patch @@ -0,0 +1,96 @@ +diff -up irqbalance-1.0.7/cputree.c.orig irqbalance-1.0.7/cputree.c +--- irqbalance-1.0.7/cputree.c.orig 2016-01-09 20:15:41.928969895 +0100 ++++ irqbalance-1.0.7/cputree.c 2016-01-09 20:16:23.502347264 +0100 +@@ -59,8 +59,8 @@ cpumask_t cpu_possible_map; + cpumask_t unbanned_cpus; + + /* +- * By default do not place IRQs on CPUs the kernel keeps isolated, +- * as specified through the isolcpus= boot commandline. Users can ++ * By default do not place IRQs on CPUs the kernel keeps isolated or ++ * nohz_full, as specified through the boot commandline. Users can + * override this with the IRQBALANCE_BANNED_CPUS environment variable. + */ + static void setup_banned_cpus(void) +@@ -69,7 +69,13 @@ static void setup_banned_cpus(void) + char *c, *line = NULL; + size_t size = 0; + const char *isolcpus = "isolcpus="; ++ const char *nohz_full_s = "nohz_full="; + char buffer[4096]; ++ cpumask_t nohz_full; ++ cpumask_t isolated_cpus; ++ ++ cpus_clear(isolated_cpus); ++ cpus_clear(nohz_full); + + /* A manually specified cpumask overrides auto-detection. */ + if (getenv("IRQBALANCE_BANNED_CPUS")) { +@@ -77,6 +83,33 @@ static void setup_banned_cpus(void) + goto out; + } + ++ file = fopen("/sys/devices/system/cpu/nohz_full", "r"); ++ if (!file) ++ goto cmdline; ++ ++ if (getline(&line, &size, file) > 0) { ++ cpulist_parse(line, size, nohz_full); ++ free(line); ++ line = NULL; ++ size = 0; ++ } ++ fclose(file); ++ ++ file = fopen("/sys/devices/system/cpu/isolated", "r"); ++ if (file) { ++ if (getline(&line, &size, file) > 0) { ++ cpulist_parse(line, size, isolated_cpus); ++ free(line); ++ line = NULL; ++ size = 0; ++ } ++ fclose(file); ++ } ++ ++ goto out2; ++ ++ cmdline: ++ + file = fopen("/proc/cmdline", "r"); + if (!file) + goto out; +@@ -92,12 +125,31 @@ static void setup_banned_cpus(void) + for (end = c; *end != ' ' && *end != '\0' && *end != '\n'; end++); + len = end - c; + +- cpulist_parse(c, len, banned_cpus); ++ cpulist_parse(c, len, isolated_cpus); + } + ++ if ((c = strstr(line, nohz_full_s))) { ++ char *end; ++ int len; ++ ++ c += strlen(nohz_full_s); ++ for (end = c; *end != ' ' && *end != '\0' && *end != '\n'; end++); ++ len = end - c; ++ ++ cpulist_parse(c, len, nohz_full); ++ } ++ ++ free(line); ++ fclose(file); ++ ++ out2: ++ cpus_or(banned_cpus, nohz_full, isolated_cpus); ++ + out: +- cpumask_scnprintf(buffer, 4096, banned_cpus); ++ cpumask_scnprintf(buffer, 4096, isolated_cpus); + log(TO_CONSOLE, LOG_INFO, "Isolated CPUs: %s\n", buffer); ++ cpumask_scnprintf(buffer, 4096, nohz_full); ++ log(TO_CONSOLE, LOG_INFO, "Adaptive-ticks CPUs: %s\n", buffer); + } + + static struct topo_obj* add_cache_domain_to_package(struct topo_obj *cache, diff --git a/SPECS/irqbalance.spec b/SPECS/irqbalance.spec index 66af4a6..62a3c12 100644 --- a/SPECS/irqbalance.spec +++ b/SPECS/irqbalance.spec @@ -1,6 +1,6 @@ Name: irqbalance Version: 1.0.7 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 3 Summary: IRQ balancing daemon @@ -39,6 +39,7 @@ Patch10:irqbalance-1.0.8-fix-cpulist_parse-definition-to-match-bitmap_parseli.pa Patch11:irqbalance-1.0.8-parse-isolcpus-from-proc-cmdline-to-set-up-banned_cp.patch Patch12:irqbalance-1.0.8-fix-memory-leak-in-classify-code.patch Patch13:irqbalance-1.0.8-separate-cmomand-line-banned-irqs.patch +Patch14:irqbalance-1.0.8-parse-isolcpus-and-nohz-cpus-from-sysfs.patch %description irqbalance is a daemon that evenly distributes IRQ load across @@ -59,6 +60,7 @@ multiple CPUs for enhanced performance. %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 %build ./autogen.sh @@ -97,6 +99,9 @@ fi /sbin/chkconfig --del irqbalance >/dev/null 2>&1 || : %changelog +* Tue Feb 02 2016 Petr Holasek - 2:1.0.7-6 +- nohz and isolated cpus are read from sysfs (#1264130) + * Mon Jul 13 2015 Petr Holasek - 2:1.0.7-5 - banned irqs aren't touched (#1237356)