aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sched.h1
-rw-r--r--kernel/sched_fair.c9
-rw-r--r--kernel/sysctl.c7
3 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8abb8aa59664..840f1277492f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1900,6 +1900,7 @@ extern unsigned int sysctl_sched_migration_cost;
1900extern unsigned int sysctl_sched_nr_migrate; 1900extern unsigned int sysctl_sched_nr_migrate;
1901extern unsigned int sysctl_sched_time_avg; 1901extern unsigned int sysctl_sched_time_avg;
1902extern unsigned int sysctl_timer_migration; 1902extern unsigned int sysctl_timer_migration;
1903extern unsigned int sysctl_sched_shares_window;
1903 1904
1904int sched_proc_update_handler(struct ctl_table *table, int write, 1905int sched_proc_update_handler(struct ctl_table *table, int write,
1905 void __user *buffer, size_t *length, 1906 void __user *buffer, size_t *length,
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index b320753aa6c9..6c84439ce987 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -89,6 +89,13 @@ unsigned int normalized_sysctl_sched_wakeup_granularity = 1000000UL;
89 89
90const_debug unsigned int sysctl_sched_migration_cost = 500000UL; 90const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
91 91
92/*
93 * The exponential sliding window over which load is averaged for shares
94 * distribution.
95 * (default: 10msec)
96 */
97unsigned int __read_mostly sysctl_sched_shares_window = 10000000UL;
98
92static const struct sched_class fair_sched_class; 99static const struct sched_class fair_sched_class;
93 100
94/************************************************************** 101/**************************************************************
@@ -688,7 +695,7 @@ account_entity_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se)
688#if defined CONFIG_SMP && defined CONFIG_FAIR_GROUP_SCHED 695#if defined CONFIG_SMP && defined CONFIG_FAIR_GROUP_SCHED
689static void update_cfs_load(struct cfs_rq *cfs_rq) 696static void update_cfs_load(struct cfs_rq *cfs_rq)
690{ 697{
691 u64 period = sched_avg_period(); 698 u64 period = sysctl_sched_shares_window;
692 u64 now, delta; 699 u64 now, delta;
693 unsigned long load = cfs_rq->load.weight; 700 unsigned long load = cfs_rq->load.weight;
694 701
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 3132b25193db..9b520d74f052 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -333,6 +333,13 @@ static struct ctl_table kern_table[] = {
333 .proc_handler = proc_dointvec, 333 .proc_handler = proc_dointvec,
334 }, 334 },
335 { 335 {
336 .procname = "sched_shares_window",
337 .data = &sysctl_sched_shares_window,
338 .maxlen = sizeof(unsigned int),
339 .mode = 0644,
340 .proc_handler = proc_dointvec,
341 },
342 {
336 .procname = "timer_migration", 343 .procname = "timer_migration",
337 .data = &sysctl_timer_migration, 344 .data = &sysctl_timer_migration,
338 .maxlen = sizeof(unsigned int), 345 .maxlen = sizeof(unsigned int),