diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index a5e8dd203..581ee7955 100755 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -44,14 +44,13 @@ extern unsigned int sysctl_numa_balancing_scan_period_min; extern unsigned int sysctl_numa_balancing_scan_period_max; extern unsigned int sysctl_numa_balancing_scan_size; - -extern __read_mostly unsigned int sysctl_sched_migration_cost; #ifdef CONFIG_SCHED_DEBUG +extern __read_mostly unsigned int sysctl_sched_migration_cost; extern __read_mostly unsigned int sysctl_sched_nr_migrate; -#endif int sched_proc_update_handler(struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos); +#endif /* * control realtime throttling: diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 39e5274ce..d99ccfab8 100755 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -88,7 +88,7 @@ unsigned int sysctl_sched_child_runs_first __read_mostly; unsigned int sysctl_sched_wakeup_granularity = 1000000UL; static unsigned int normalized_sysctl_sched_wakeup_granularity = 1000000UL; -unsigned int __read_mostly sysctl_sched_migration_cost = 500000UL; +const_debug unsigned int sysctl_sched_migration_cost = 500000UL; int sched_thermal_decay_shift; static int __init setup_sched_thermal_decay_shift(char *str) @@ -648,7 +648,6 @@ struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq) return rb_entry(last, struct sched_entity, run_node); } -#endif /************************************************************** * Scheduling class statistics methods: @@ -675,6 +674,7 @@ int sched_proc_update_handler(struct ctl_table *table, int write, return 0; } +#endif /* * delta /= w diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 6de9ccc79..114866ab4 100755 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2079,7 +2079,7 @@ extern void deactivate_task(struct rq *rq, struct task_struct *p, int flags); extern void check_preempt_curr(struct rq *rq, struct task_struct *p, int flags); extern const_debug unsigned int sysctl_sched_nr_migrate; -extern unsigned int __read_mostly sysctl_sched_migration_cost; +extern const_debug unsigned int sysctl_sched_migration_cost; #ifdef CONFIG_SCHED_HRTICK diff --git a/kernel/sysctl.c b/kernel/sysctl.c index f7025662b..f616d1de0 100755 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -192,6 +192,7 @@ static enum sysctl_writes_mode sysctl_writes_strict = SYSCTL_WRITES_STRICT; int sysctl_legacy_va_layout; #endif +#ifdef CONFIG_SCHED_DEBUG static int min_sched_granularity_ns = 100000; /* 100 usecs */ static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ static int min_wakeup_granularity_ns; /* 0 usecs */ @@ -200,6 +201,7 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; #endif /* CONFIG_SMP */ +#endif /* CONFIG_SCHED_DEBUG */ #ifdef CONFIG_COMPACTION static int min_extfrag_threshold; @@ -1801,6 +1803,16 @@ static struct ctl_table kern_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, +#ifdef CONFIG_SCHED_DEBUG + { + .procname = "sched_min_granularity_ns", + .data = &sysctl_sched_min_granularity, + .maxlen = sizeof(unsigned int), + .mode = 0644, + .proc_handler = sched_proc_update_handler, + .extra1 = &min_sched_granularity_ns, + .extra2 = &max_sched_granularity_ns, + }, { .procname = "sched_latency_ns", .data = &sysctl_sched_latency, @@ -1836,18 +1848,6 @@ static struct ctl_table kern_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, -#endif -#ifdef CONFIG_SCHED_DEBUG - { - .procname = "sched_min_granularity_ns", - .data = &sysctl_sched_min_granularity, - .maxlen = sizeof(unsigned int), - .mode = 0644, - .proc_handler = sched_proc_update_handler, - .extra1 = &min_sched_granularity_ns, - .extra2 = &max_sched_granularity_ns, - }, -#ifdef CONFIG_SMP { .procname = "sched_nr_migrate", .data = &sysctl_sched_nr_migrate,