Loading Documentation/scheduler/sched-hmp.txt +1 −1 Original line number Diff line number Diff line Loading @@ -1247,7 +1247,7 @@ the CPU. ** 7.23 sched_prefer_idle Appears at: /proc/sys/kernel/sched_prefer_idle Appears at: /sys/devices/system/cpu/cpuX/sched_prefer_idle Default value: 1 Loading drivers/base/cpu.c +43 −1 Original line number Diff line number Diff line Loading @@ -277,13 +277,52 @@ static ssize_t __ref store_sched_mostly_idle_nr_run(struct device *dev, return err; } static ssize_t show_sched_prefer_idle(struct device *dev, struct device_attribute *attr, char *buf) { struct cpu *cpu = container_of(dev, struct cpu, dev); ssize_t rc; int cpunum; int prefer_idle; cpunum = cpu->dev.id; prefer_idle = sched_get_cpu_prefer_idle(cpunum); rc = snprintf(buf, PAGE_SIZE-2, "%d\n", prefer_idle); return rc; } static ssize_t __ref store_sched_prefer_idle(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct cpu *cpu = container_of(dev, struct cpu, dev); int cpuid = cpu->dev.id; int prefer_idle, err; err = kstrtoint(strstrip((char *)buf), 0, &prefer_idle); if (err) return err; err = sched_set_cpu_prefer_idle(cpuid, prefer_idle); if (err >= 0) err = count; return err; } static DEVICE_ATTR(sched_mostly_idle_freq, 0664, show_sched_mostly_idle_freq, store_sched_mostly_idle_freq); static DEVICE_ATTR(sched_mostly_idle_load, 0664, show_sched_mostly_idle_load, store_sched_mostly_idle_load); static DEVICE_ATTR(sched_mostly_idle_nr_run, 0664, show_sched_mostly_idle_nr_run, store_sched_mostly_idle_nr_run); #endif static DEVICE_ATTR(sched_prefer_idle, 0664, show_sched_prefer_idle, store_sched_prefer_idle); #endif /* CONFIG_SCHED_HMP */ /* * Print cpu online, possible, present, and system maps Loading Loading @@ -465,6 +504,9 @@ int __cpuinit register_cpu(struct cpu *cpu, int num) if (!error) error = device_create_file(&cpu->dev, &dev_attr_sched_mostly_idle_freq); if (!error) error = device_create_file(&cpu->dev, &dev_attr_sched_prefer_idle); #endif return error; Loading include/linux/sched.h +2 −0 Original line number Diff line number Diff line Loading @@ -1918,6 +1918,8 @@ sched_set_cpu_cstate(int cpu, int cstate, int wakeup_energy, int wakeup_latency) extern int sched_set_boost(int enable); extern int sched_set_init_task_load(struct task_struct *p, int init_load_pct); extern u32 sched_get_init_task_load(struct task_struct *p); extern int sched_set_cpu_prefer_idle(int cpu, int prefer_idle); extern int sched_get_cpu_prefer_idle(int cpu); extern int sched_set_cpu_mostly_idle_load(int cpu, int mostly_idle_pct); extern int sched_get_cpu_mostly_idle_load(int cpu); extern int sched_set_cpu_mostly_idle_nr_run(int cpu, int nr_run); Loading include/linux/sched/sysctl.h +0 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,6 @@ extern unsigned int sysctl_sched_small_task_pct; extern unsigned int sysctl_sched_upmigrate_pct; extern unsigned int sysctl_sched_downmigrate_pct; extern int sysctl_sched_upmigrate_min_nice; extern unsigned int sysctl_sched_prefer_idle; extern unsigned int sysctl_sched_powerband_limit_pct; extern unsigned int sysctl_sched_boost; Loading kernel/sched/core.c +1 −0 Original line number Diff line number Diff line Loading @@ -9039,6 +9039,7 @@ void __init sched_init(void) rq->cur_irqload = 0; rq->avg_irqload = 0; rq->irqload_ts = 0; rq->prefer_idle = 1; #ifdef CONFIG_SCHED_FREQ_INPUT rq->old_busy_time = 0; rq->curr_runnable_sum = rq->prev_runnable_sum = 0; Loading Loading
Documentation/scheduler/sched-hmp.txt +1 −1 Original line number Diff line number Diff line Loading @@ -1247,7 +1247,7 @@ the CPU. ** 7.23 sched_prefer_idle Appears at: /proc/sys/kernel/sched_prefer_idle Appears at: /sys/devices/system/cpu/cpuX/sched_prefer_idle Default value: 1 Loading
drivers/base/cpu.c +43 −1 Original line number Diff line number Diff line Loading @@ -277,13 +277,52 @@ static ssize_t __ref store_sched_mostly_idle_nr_run(struct device *dev, return err; } static ssize_t show_sched_prefer_idle(struct device *dev, struct device_attribute *attr, char *buf) { struct cpu *cpu = container_of(dev, struct cpu, dev); ssize_t rc; int cpunum; int prefer_idle; cpunum = cpu->dev.id; prefer_idle = sched_get_cpu_prefer_idle(cpunum); rc = snprintf(buf, PAGE_SIZE-2, "%d\n", prefer_idle); return rc; } static ssize_t __ref store_sched_prefer_idle(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct cpu *cpu = container_of(dev, struct cpu, dev); int cpuid = cpu->dev.id; int prefer_idle, err; err = kstrtoint(strstrip((char *)buf), 0, &prefer_idle); if (err) return err; err = sched_set_cpu_prefer_idle(cpuid, prefer_idle); if (err >= 0) err = count; return err; } static DEVICE_ATTR(sched_mostly_idle_freq, 0664, show_sched_mostly_idle_freq, store_sched_mostly_idle_freq); static DEVICE_ATTR(sched_mostly_idle_load, 0664, show_sched_mostly_idle_load, store_sched_mostly_idle_load); static DEVICE_ATTR(sched_mostly_idle_nr_run, 0664, show_sched_mostly_idle_nr_run, store_sched_mostly_idle_nr_run); #endif static DEVICE_ATTR(sched_prefer_idle, 0664, show_sched_prefer_idle, store_sched_prefer_idle); #endif /* CONFIG_SCHED_HMP */ /* * Print cpu online, possible, present, and system maps Loading Loading @@ -465,6 +504,9 @@ int __cpuinit register_cpu(struct cpu *cpu, int num) if (!error) error = device_create_file(&cpu->dev, &dev_attr_sched_mostly_idle_freq); if (!error) error = device_create_file(&cpu->dev, &dev_attr_sched_prefer_idle); #endif return error; Loading
include/linux/sched.h +2 −0 Original line number Diff line number Diff line Loading @@ -1918,6 +1918,8 @@ sched_set_cpu_cstate(int cpu, int cstate, int wakeup_energy, int wakeup_latency) extern int sched_set_boost(int enable); extern int sched_set_init_task_load(struct task_struct *p, int init_load_pct); extern u32 sched_get_init_task_load(struct task_struct *p); extern int sched_set_cpu_prefer_idle(int cpu, int prefer_idle); extern int sched_get_cpu_prefer_idle(int cpu); extern int sched_set_cpu_mostly_idle_load(int cpu, int mostly_idle_pct); extern int sched_get_cpu_mostly_idle_load(int cpu); extern int sched_set_cpu_mostly_idle_nr_run(int cpu, int nr_run); Loading
include/linux/sched/sysctl.h +0 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,6 @@ extern unsigned int sysctl_sched_small_task_pct; extern unsigned int sysctl_sched_upmigrate_pct; extern unsigned int sysctl_sched_downmigrate_pct; extern int sysctl_sched_upmigrate_min_nice; extern unsigned int sysctl_sched_prefer_idle; extern unsigned int sysctl_sched_powerband_limit_pct; extern unsigned int sysctl_sched_boost; Loading
kernel/sched/core.c +1 −0 Original line number Diff line number Diff line Loading @@ -9039,6 +9039,7 @@ void __init sched_init(void) rq->cur_irqload = 0; rq->avg_irqload = 0; rq->irqload_ts = 0; rq->prefer_idle = 1; #ifdef CONFIG_SCHED_FREQ_INPUT rq->old_busy_time = 0; rq->curr_runnable_sum = rq->prev_runnable_sum = 0; Loading