diff --git a/init/Kconfig b/init/Kconfig index 230ca4e1b..c81bad47d 100755 --- a/init/Kconfig +++ b/init/Kconfig @@ -856,6 +856,42 @@ config UCLAMP_BUCKETS_COUNT endmenu +menu "FAIR Scheuler tunables" + +choice + prompt "Utilization's PELT half-Life" + default PELT_UTIL_HALFLIFE_DEFAULT + help + Allows choosing one of the possible values for the PELT half-life to + be used for the update of the utilization of tasks and CPUs. + The half-life is the amount of [ms] required by the PELT signal to + build up to 50% utilization. The higher the half-life the longer it + takes for a task to be represented as a big one. + + Note that adjusting PELT half-life via kernel parameters is only + allowed when PELT_UTIL_HALFLIFE_DEFAULT is selected. + + If not sure, use the default. + +config PELT_UTIL_HALFLIFE_DEFAULT + bool "Default (32 ms)" + +config PELT_UTIL_HALFLIFE_32 + bool "32 ms" + +config PELT_UTIL_HALFLIFE_16 + bool "16 ms" + +config PELT_UTIL_HALFLIFE_12 + bool "12 ms" + +config PELT_UTIL_HALFLIFE_8 + bool "8 ms" + +endchoice + +endmenu # FAIR Scheduler tunables" + # # For architectures that want to enable the support for NUMA-affine scheduler # balancing logic: diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c index 15a237ab2..a83794cec 100755 --- a/kernel/sched/pelt.c +++ b/kernel/sched/pelt.c @@ -28,9 +28,23 @@ #include "sched.h" #include "pelt.h" +#if IS_ENABLED(CONFIG_PELT_UTIL_HALFLIFE_8) +int pelt_load_avg_period = PELT8_LOAD_AVG_PERIOD; +int pelt_load_avg_max = PELT8_LOAD_AVG_MAX; +const u32 *pelt_runnable_avg_yN_inv = pelt8_runnable_avg_yN_inv; +#elif IS_ENABLED(CONFIG_PELT_UTIL_HALFLIFE_12) +int pelt_load_avg_period = PELT12_LOAD_AVG_PERIOD; +int pelt_load_avg_max = PELT12_LOAD_AVG_MAX; +const u32 *pelt_runnable_avg_yN_inv = pelt12_runnable_avg_yN_inv; +#elif IS_ENABLED(CONFIG_PELT_UTIL_HALFLIFE_16) +int pelt_load_avg_period = PELT16_LOAD_AVG_PERIOD; +int pelt_load_avg_max = PELT16_LOAD_AVG_MAX; +const u32 *pelt_runnable_avg_yN_inv = pelt16_runnable_avg_yN_inv; +#elif IS_ENABLED(CONFIG_PELT_UTIL_HALFLIFE_DEFAULT) || IS_ENABLED(CONFIG_PELT_UTIL_HALFLIFE_32) int pelt_load_avg_period = PELT32_LOAD_AVG_PERIOD; int pelt_load_avg_max = PELT32_LOAD_AVG_MAX; const u32 *pelt_runnable_avg_yN_inv = pelt32_runnable_avg_yN_inv; +#endif int get_pelt_halflife(void) { @@ -71,6 +85,7 @@ int set_pelt_halflife(int num) } EXPORT_SYMBOL_GPL(set_pelt_halflife); +#if IS_ENABLED(CONFIG_PELT_UTIL_HALFLIFE_DEFAULT) static int __init set_pelt(char *str) { int rc, num; @@ -86,6 +101,7 @@ static int __init set_pelt(char *str) } early_param("pelt", set_pelt); +#endif /* * Approximate: