summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Muckle <smuckle@codeaurora.org>2014-11-30 16:26:55 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:01:11 -0700
commit588055e8c73e8ef0c8c23ab5db45453aa49be665 (patch)
tree3b3a776dc6201f599eb2614d64211192da5e13a8
parent6bde9f65b3cc676647e3d1b8285ab1e7b0d32763 (diff)
sched: make sched_cpu_high_irqload a runtime tunable
It may be desirable to be able to alter the scehd_cpu_high_irqload setting easily, so make it a runtime tunable value. Change-Id: I832030eec2aafa101f0f435a4fd2d401d447880d Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
-rw-r--r--Documentation/scheduler/sched-hmp.txt18
-rw-r--r--include/linux/sched/sysctl.h1
-rw-r--r--kernel/sched/core.c2
-rw-r--r--kernel/sched/sched.h3
-rw-r--r--kernel/sysctl.c7
5 files changed, 29 insertions, 2 deletions
diff --git a/Documentation/scheduler/sched-hmp.txt b/Documentation/scheduler/sched-hmp.txt
index a8d9e08cc19b..ecbbaec5372c 100644
--- a/Documentation/scheduler/sched-hmp.txt
+++ b/Documentation/scheduler/sched-hmp.txt
@@ -1351,6 +1351,24 @@ frequency. Hence it is strongly advised to have all cpus in a cluster have the
same value for mostly_idle_freq. For more details, see section on "Task
packing" (sec 5.6).
+*** 7.22 sched_cpu_high_irqload
+
+Appears at: /proc/sys/kernel/sched_cpu_high_irqload
+
+Default value: 10000000 (10ms)
+
+The scheduler keeps a decaying average of the amount of irq and softirq activity
+seen on each CPU within a ten millisecond window. Note that this "irqload"
+(reported in the sched_cpu_load tracepoint) will be higher than the typical load
+in a single window since every time the window rolls over, the value is decayed
+by some fraction and then added to the irq/softirq time spent in the next
+window.
+
+When the irqload on a CPU exceeds the value of this tunable, the CPU is no
+longer eligible to be seen as mostly idle. This will affect the task placement
+logic described above, causing the scheduler to try and steer tasks away from
+the CPU.
+
=========================
8. HMP SCHEDULER TRACE POINTS
=========================
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
index bd2abda891cd..a400b155bb47 100644
--- a/include/linux/sched/sysctl.h
+++ b/include/linux/sched/sysctl.h
@@ -44,6 +44,7 @@ extern unsigned int sysctl_sched_wakeup_load_threshold;
extern unsigned int sysctl_sched_window_stats_policy;
extern unsigned int sysctl_sched_account_wait_time;
extern unsigned int sysctl_sched_ravg_hist_size;
+extern unsigned int sysctl_sched_cpu_high_irqload;
extern unsigned int sysctl_sched_freq_account_wait_time;
extern unsigned int sysctl_sched_migration_fixup;
extern unsigned int sysctl_sched_heavy_task_pct;
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2c9bc22703ef..b900b2de3990 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1182,6 +1182,8 @@ __read_mostly unsigned int sysctl_sched_window_stats_policy =
static __read_mostly unsigned int sched_account_wait_time = 1;
__read_mostly unsigned int sysctl_sched_account_wait_time = 1;
+__read_mostly unsigned int sysctl_sched_cpu_high_irqload = (10 * NSEC_PER_MSEC);
+
#ifdef CONFIG_SCHED_FREQ_INPUT
static __read_mostly unsigned int sched_migration_fixup = 1;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index cb0de7630d8b..a53383d6bf6c 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1046,10 +1046,9 @@ static inline u64 sched_irqload(int cpu)
return 0;
}
-#define SCHED_HIGH_IRQ_NS (10 * NSEC_PER_MSEC)
static inline int sched_cpu_high_irqload(int cpu)
{
- return sched_irqload(cpu) >= SCHED_HIGH_IRQ_NS;
+ return sched_irqload(cpu) >= sysctl_sched_cpu_high_irqload;
}
#else /* CONFIG_SCHED_HMP */
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 2281f24194db..738b154269ea 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -345,6 +345,13 @@ static struct ctl_table kern_table[] = {
.proc_handler = sched_window_update_handler,
},
{
+ .procname = "sched_cpu_high_irqload",
+ .data = &sysctl_sched_cpu_high_irqload,
+ .maxlen = sizeof(unsigned int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
+ {
.procname = "sched_ravg_hist_size",
.data = &sysctl_sched_ravg_hist_size,
.maxlen = sizeof(unsigned int),