Skip to content
This repository has been archived by the owner on Nov 14, 2021. It is now read-only.

Commit

Permalink
[FIXUP] 441d1a2 ("sysctl: Expose a few additional sched features to a…
Browse files Browse the repository at this point in the history
…ppease OOS when !SCHED_WALT")

Signed-off-by: Adam W. Willis <[email protected]>
  • Loading branch information
0ctobot committed Aug 30, 2021
1 parent 4c20b9a commit be026b4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
3 changes: 0 additions & 3 deletions include/linux/sched/sysctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ extern int sched_updown_migrate_handler(struct ctl_table *table,
extern unsigned int sysctl_sched_boost;
extern unsigned int sysctl_sched_min_task_util_for_boost;
extern unsigned int sysctl_sched_min_task_util_for_colocation;
extern unsigned int sysctl_sched_prefer_spread;
static unsigned int sysctl_sched_busy_hyst_enable_cpus;
static unsigned int sysctl_sched_busy_hyst;
#endif

#if defined(CONFIG_PREEMPTIRQ_EVENTS) || defined(CONFIG_PREEMPT_TRACER)
Expand Down
41 changes: 37 additions & 4 deletions kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ static unsigned int ns_per_sec = NSEC_PER_SEC;
#ifdef CONFIG_SCHED_WALT
const int sched_user_hint_max = 1000;
static unsigned int one_hundred_thousand = 100000;
#else
static unsigned int sysctl_sched_prefer_spread;
static unsigned int sysctl_sched_busy_hyst_enable_cpus;
static unsigned int sysctl_sched_busy_hyst;
static unsigned int __read_mostly sysctl_sched_group_upmigrate_pct = 100;
static unsigned int __read_mostly sysctl_sched_group_downmigrate_pct = 95;
static unsigned int sysctl_sched_ravg_window_nr_ticks;
#endif
/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
Expand Down Expand Up @@ -246,8 +253,10 @@ static int proc_dostring_coredump(struct ctl_table *table, int write,
#endif
static int proc_dopipe_max_size(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
#ifdef CONFIG_SCHED_WALT
static int proc_douintvec_minmax_schedhyst(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
#endif

#ifdef CONFIG_MAGIC_SYSRQ
/* Note: sysrq code uses its own private copy */
Expand Down Expand Up @@ -608,7 +617,7 @@ static struct ctl_table kern_table[] = {
.data = &sysctl_sched_busy_hyst_enable_cpus,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_douintvec_minmax_schedhyst,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &two_hundred_fifty_five,
},
Expand All @@ -617,10 +626,34 @@ static struct ctl_table kern_table[] = {
.data = &sysctl_sched_busy_hyst,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_douintvec_minmax_schedhyst,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &ns_per_sec,
},
{
.procname = "sched_group_upmigrate",
.data = &sysctl_sched_group_upmigrate_pct,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &sysctl_sched_group_downmigrate_pct,
},
{
.procname = "sched_group_downmigrate",
.data = &sysctl_sched_group_downmigrate_pct,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &sysctl_sched_group_upmigrate_pct,
},
{
.procname = "sched_ravg_window_nr_ticks",
.data = &sysctl_sched_ravg_window_nr_ticks,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
},
#endif
{
.procname = "sched_force_lb_enable",
Expand Down Expand Up @@ -3248,18 +3281,18 @@ static int proc_dostring_coredump(struct ctl_table *table, int write,
}
#endif

#ifdef CONFIG_SCHED_WALT
static int proc_douintvec_minmax_schedhyst(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret = proc_douintvec_minmax(table, write, buffer, lenp, ppos);

#ifdef CONFIG_SCHED_WALT
if (!ret && write)
sched_update_hyst_times();
#endif

return ret;
}
#endif

static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
void __user *buffer,
Expand Down

0 comments on commit be026b4

Please sign in to comment.