diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index b54ecf84b6be..116efed962c6 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -7033,7 +7033,20 @@ cpumask_var_t nohz_cpu_mask; | |||
7033 | static void update_sysctl(void) | 7033 | static void update_sysctl(void) |
7034 | { | 7034 | { |
7035 | unsigned int cpus = min(num_online_cpus(), 8U); | 7035 | unsigned int cpus = min(num_online_cpus(), 8U); |
7036 | unsigned int factor = 1 + ilog2(cpus); | 7036 | unsigned int factor; |
7037 | |||
7038 | switch (sysctl_sched_tunable_scaling) { | ||
7039 | case SCHED_TUNABLESCALING_NONE: | ||
7040 | factor = 1; | ||
7041 | break; | ||
7042 | case SCHED_TUNABLESCALING_LINEAR: | ||
7043 | factor = cpus; | ||
7044 | break; | ||
7045 | case SCHED_TUNABLESCALING_LOG: | ||
7046 | default: | ||
7047 | factor = 1 + ilog2(cpus); | ||
7048 | break; | ||
7049 | } | ||
7037 | 7050 | ||
7038 | #define SET_SYSCTL(name) \ | 7051 | #define SET_SYSCTL(name) \ |
7039 | (sysctl_##name = (factor) * normalized_sysctl_##name) | 7052 | (sysctl_##name = (factor) * normalized_sysctl_##name) |