diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 6798328a2e0e..a40ab657ad19 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -4911,14 +4911,18 @@ cpumask_t nohz_cpu_mask = CPU_MASK_NONE; | |||
4911 | static inline void sched_init_granularity(void) | 4911 | static inline void sched_init_granularity(void) |
4912 | { | 4912 | { |
4913 | unsigned int factor = 1 + ilog2(num_online_cpus()); | 4913 | unsigned int factor = 1 + ilog2(num_online_cpus()); |
4914 | const unsigned long gran_limit = 100000000; | 4914 | const unsigned long limit = 100000000; |
4915 | 4915 | ||
4916 | sysctl_sched_granularity *= factor; | 4916 | sysctl_sched_min_granularity *= factor; |
4917 | if (sysctl_sched_granularity > gran_limit) | 4917 | if (sysctl_sched_min_granularity > limit) |
4918 | sysctl_sched_granularity = gran_limit; | 4918 | sysctl_sched_min_granularity = limit; |
4919 | 4919 | ||
4920 | sysctl_sched_runtime_limit = sysctl_sched_granularity * 5; | 4920 | sysctl_sched_latency *= factor; |
4921 | sysctl_sched_wakeup_granularity = sysctl_sched_granularity / 2; | 4921 | if (sysctl_sched_latency > limit) |
4922 | sysctl_sched_latency = limit; | ||
4923 | |||
4924 | sysctl_sched_runtime_limit = sysctl_sched_latency * 5; | ||
4925 | sysctl_sched_wakeup_granularity = sysctl_sched_latency / 2; | ||
4922 | } | 4926 | } |
4923 | 4927 | ||
4924 | #ifdef CONFIG_SMP | 4928 | #ifdef CONFIG_SMP |