Skip to content

Commit

Permalink
ZEN: INTERACTIVE: Tune CFS for interactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
heftig committed Jan 27, 2020
1 parent 90f3ec2 commit 7de2596
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
8 changes: 8 additions & 0 deletions init/Kconfig
Expand Up @@ -94,6 +94,14 @@ config ZEN_INTERACTIVE
Zswap default pool.............: zbud -> z3fold
Zswap default compressor.......: LZO -> LZ4

--- CFS CPU Scheduler ----------------------------------

Scheduling latency.............: 6 -> 4 ms
Minimal granularity............: 0.75 -> 0.4 ms
Wakeup granularity.............: 1 -> 0.5 ms
CPU migration cost.............: 0.5 -> 0.25 ms
Bandwidth slice size...........: 5 -> 3 ms

config BROKEN
bool

Expand Down
25 changes: 25 additions & 0 deletions kernel/sched/fair.c
Expand Up @@ -37,8 +37,13 @@
*
* (default: 6ms * (1 + ilog(ncpus)), units: nanoseconds)
*/
#ifdef CONFIG_ZEN_INTERACTIVE
unsigned int sysctl_sched_latency = 4000000ULL;
static unsigned int normalized_sysctl_sched_latency = 4000000ULL;
#else
unsigned int sysctl_sched_latency = 6000000ULL;
static unsigned int normalized_sysctl_sched_latency = 6000000ULL;
#endif

/*
* The initial- and re-scaling of tunables is configurable
Expand All @@ -58,13 +63,22 @@ enum sched_tunable_scaling sysctl_sched_tunable_scaling = SCHED_TUNABLESCALING_L
*
* (default: 0.75 msec * (1 + ilog(ncpus)), units: nanoseconds)
*/
#ifdef CONFIG_ZEN_INTERACTIVE
unsigned int sysctl_sched_min_granularity = 400000ULL;
static unsigned int normalized_sysctl_sched_min_granularity = 400000ULL;
#else
unsigned int sysctl_sched_min_granularity = 750000ULL;
static unsigned int normalized_sysctl_sched_min_granularity = 750000ULL;
#endif

/*
* This value is kept at sysctl_sched_latency/sysctl_sched_min_granularity
*/
#ifdef CONFIG_ZEN_INTERACTIVE
static unsigned int sched_nr_latency = 10;
#else
static unsigned int sched_nr_latency = 8;
#endif

/*
* After fork, child runs first. If set to 0 (default) then
Expand All @@ -81,10 +95,17 @@ unsigned int sysctl_sched_child_runs_first __read_mostly;
*
* (default: 1 msec * (1 + ilog(ncpus)), units: nanoseconds)
*/
#ifdef CONFIG_ZEN_INTERACTIVE
unsigned int sysctl_sched_wakeup_granularity = 500000UL;
static unsigned int normalized_sysctl_sched_wakeup_granularity = 500000UL;

const_debug unsigned int sysctl_sched_migration_cost = 250000UL;
#else
unsigned int sysctl_sched_wakeup_granularity = 1000000UL;
static unsigned int normalized_sysctl_sched_wakeup_granularity = 1000000UL;

const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
#endif

#ifdef CONFIG_SMP
/*
Expand Down Expand Up @@ -115,8 +136,12 @@ int __weak arch_asym_cpu_priority(int cpu)
*
* (default: 5 msec, units: microseconds)
*/
#ifdef CONFIG_ZEN_INTERACTIVE
unsigned int sysctl_sched_cfs_bandwidth_slice = 3000UL;
#else
unsigned int sysctl_sched_cfs_bandwidth_slice = 5000UL;
#endif
#endif

static inline void update_load_add(struct load_weight *lw, unsigned long inc)
{
Expand Down

0 comments on commit 7de2596

Please sign in to comment.