[RFC PATCH V2 10/19] sched: detect wakeup burst with rq->avg_idle

From: Preeti U Murthy
Date: Mon Aug 11 2014 - 07:38:03 EST


From: Alex Shi <alex.shi@xxxxxxxxx>

rq->avg_idle is 'to used to accommodate bursty loads in a dirt simple
dirt cheap manner' -- Mike Galbraith.

With this cheap and smart bursty indicator, we can find the wake up
burst, and just use nr_running as instant utilization only.

The 'sysctl_sched_burst_threshold' used for wakeup burst, set it as
double of sysctl_sched_migration_cost.

Signed-off-by: Alex Shi <alex.shi@xxxxxxxxx>
[Added CONFIG_SCHED_POWER switch to enable this patch]
Signed-off-by: Preeti U Murthy <preeti@xxxxxxxxxxxxxxxxxx>
---

include/linux/sched/sysctl.h | 3 +++
kernel/sched/fair.c | 4 ++++
kernel/sysctl.c | 9 +++++++++
3 files changed, 16 insertions(+)

diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
index 596a0e0..0a3307b 100644
--- a/include/linux/sched/sysctl.h
+++ b/include/linux/sched/sysctl.h
@@ -55,6 +55,9 @@ extern unsigned int sysctl_numa_balancing_scan_size;

#ifdef CONFIG_SCHED_DEBUG
extern unsigned int sysctl_sched_migration_cost;
+#ifdef CONFIG_SCHED_POWER
+extern unsigned int sysctl_sched_burst_threshold;
+#endif /* CONFIG_SCHED_POWER */
extern unsigned int sysctl_sched_nr_migrate;
extern unsigned int sysctl_sched_time_avg;
extern unsigned int sysctl_timer_migration;
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 60abaf4..20e2414 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -92,6 +92,10 @@ unsigned int normalized_sysctl_sched_wakeup_granularity = 1000000UL;

const_debug unsigned int sysctl_sched_migration_cost = 500000UL;

+#ifdef CONFIG_SCHED_POWER
+const_debug unsigned int sysctl_sched_burst_threshold = 1000000UL;
+#endif
+
/*
* The exponential sliding window over which load is averaged for shares
* distribution.
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 75875a7..8175d93 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -329,6 +329,15 @@ static struct ctl_table kern_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec,
},
+#ifdef CONFIG_SCHED_POWER
+ {
+ .procname = "sched_burst_threshold_ns",
+ .data = &sysctl_sched_burst_threshold,
+ .maxlen = sizeof(unsigned int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
+#endif /* CONFIG_SCHED_POWER */
{
.procname = "sched_nr_migrate",
.data = &sysctl_sched_nr_migrate,

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/