mirror of
https://github.com/LineageOS/android_kernel_fxtec_sm6115.git
synced 2026-08-19 00:41:08 +00:00
sched: Use bitmask for sched_busy_hysteresis_enable_cpus tunable
The current code is using a bitmap for sched_busy_hysteresis_enable_cpus tunable. Since the feature is not enabled for any of the CPUs, the default value is printed as "\n". This is very inconvenient for user space applications which tries to write a new value and try to restore the previous value. Like other scheduler tunables, use the bitmask to avoid this issue. Change-Id: I0c5989606352be5382dd688602aefd753fb62317 Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
This commit is contained in:
@ -131,6 +131,6 @@ extern int sched_little_cluster_coloc_fmin_khz_handler(struct ctl_table *table,
|
||||
extern char sched_lib_name[LIB_PATH_LENGTH];
|
||||
extern unsigned int sched_lib_mask_force;
|
||||
extern bool is_sched_lib_based_app(pid_t pid);
|
||||
extern unsigned long *sched_busy_hysteresis_cpubits;
|
||||
extern unsigned int sysctl_sched_busy_hysteresis_enable_cpus;
|
||||
|
||||
#endif /* _LINUX_SCHED_SYSCTL_H */
|
||||
|
||||
@ -26,9 +26,7 @@ static DEFINE_PER_CPU(unsigned long, iowait_prod_sum);
|
||||
static DEFINE_PER_CPU(spinlock_t, nr_lock) = __SPIN_LOCK_UNLOCKED(nr_lock);
|
||||
static s64 last_get_time;
|
||||
|
||||
static struct cpumask sched_busy_hysteresis_cpumask;
|
||||
unsigned long *sched_busy_hysteresis_cpubits =
|
||||
cpumask_bits(&sched_busy_hysteresis_cpumask);
|
||||
unsigned int sysctl_sched_busy_hysteresis_enable_cpus;
|
||||
static DEFINE_PER_CPU(atomic64_t, last_busy_time) = ATOMIC64_INIT(0);
|
||||
|
||||
#define NR_THRESHOLD_PCT 15
|
||||
@ -107,7 +105,7 @@ static inline void update_last_busy_time(int cpu, bool dequeue,
|
||||
{
|
||||
bool nr_run_trigger = false, load_trigger = false;
|
||||
|
||||
if (!cpumask_test_cpu(cpu, &sched_busy_hysteresis_cpumask))
|
||||
if (!(BIT(cpu) & sysctl_sched_busy_hysteresis_enable_cpus))
|
||||
return;
|
||||
|
||||
if (prev_nr_run >= BUSY_NR_RUN && per_cpu(nr, cpu) < BUSY_NR_RUN)
|
||||
|
||||
@ -442,10 +442,12 @@ static struct ctl_table kern_table[] = {
|
||||
},
|
||||
{
|
||||
.procname = "sched_busy_hysteresis_enable_cpus",
|
||||
.data = &sched_busy_hysteresis_cpubits,
|
||||
.maxlen = NR_CPUS,
|
||||
.data = &sysctl_sched_busy_hysteresis_enable_cpus,
|
||||
.maxlen = sizeof(unsigned int),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_do_large_bitmap,
|
||||
.proc_handler = proc_douintvec_minmax,
|
||||
.extra1 = &zero,
|
||||
.extra2 = &two_hundred_fifty_five,
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_SCHED_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user