diff options
-rw-r--r-- | kernel/sched.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 282d037c7300..2520923a0c3b 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -4898,32 +4898,6 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu) | |||
4898 | */ | 4898 | */ |
4899 | cpumask_t nohz_cpu_mask = CPU_MASK_NONE; | 4899 | cpumask_t nohz_cpu_mask = CPU_MASK_NONE; |
4900 | 4900 | ||
4901 | /* | ||
4902 | * Increase the granularity value when there are more CPUs, | ||
4903 | * because with more CPUs the 'effective latency' as visible | ||
4904 | * to users decreases. But the relationship is not linear, | ||
4905 | * so pick a second-best guess by going with the log2 of the | ||
4906 | * number of CPUs. | ||
4907 | * | ||
4908 | * This idea comes from the SD scheduler of Con Kolivas: | ||
4909 | */ | ||
4910 | static inline void sched_init_granularity(void) | ||
4911 | { | ||
4912 | unsigned int factor = 1 + ilog2(num_online_cpus()); | ||
4913 | const unsigned long limit = 100000000; | ||
4914 | |||
4915 | sysctl_sched_min_granularity *= factor; | ||
4916 | if (sysctl_sched_min_granularity > limit) | ||
4917 | sysctl_sched_min_granularity = limit; | ||
4918 | |||
4919 | sysctl_sched_latency *= factor; | ||
4920 | if (sysctl_sched_latency > limit) | ||
4921 | sysctl_sched_latency = limit; | ||
4922 | |||
4923 | sysctl_sched_runtime_limit = sysctl_sched_latency; | ||
4924 | sysctl_sched_wakeup_granularity = sysctl_sched_min_granularity / 2; | ||
4925 | } | ||
4926 | |||
4927 | #ifdef CONFIG_SMP | 4901 | #ifdef CONFIG_SMP |
4928 | /* | 4902 | /* |
4929 | * This is how migration works: | 4903 | * This is how migration works: |
@@ -6491,12 +6465,10 @@ void __init sched_init_smp(void) | |||
6491 | /* Move init over to a non-isolated CPU */ | 6465 | /* Move init over to a non-isolated CPU */ |
6492 | if (set_cpus_allowed(current, non_isolated_cpus) < 0) | 6466 | if (set_cpus_allowed(current, non_isolated_cpus) < 0) |
6493 | BUG(); | 6467 | BUG(); |
6494 | sched_init_granularity(); | ||
6495 | } | 6468 | } |
6496 | #else | 6469 | #else |
6497 | void __init sched_init_smp(void) | 6470 | void __init sched_init_smp(void) |
6498 | { | 6471 | { |
6499 | sched_init_granularity(); | ||
6500 | } | 6472 | } |
6501 | #endif /* CONFIG_SMP */ | 6473 | #endif /* CONFIG_SMP */ |
6502 | 6474 | ||