Skip to content

Commit 2e8cd82

Browse files
kdrag0nExactExampl
authored andcommitted
HACK: sched/tune: clamp boosts with a value of 10
To improve battery life, avoid keeping top-app boosted all the time. By default, the Pixel 3's userspace daemons permanently boost it by 10 and boost it to 50 on user interaction. We don't need it to stay boosted during idle, so return it to 0 when userspace sets 10 or less. From the commit description of Dynamic SchedTune Boost: Dynamic SchedTune Boost occurs on-the-fly during interactions, such as touch input. This idea was conceived because of an existing battery drain issue whereby setting a permanent schedtune boost would cause boosting to occur even when the phone was idling. For example, if a user sets the /dev/stune/top-app/schedtune.boost to 10, the device may not idle at the lowest frequency step, which can lead to higher idle and active drain rates. Thus it should consume less power to boost only during interactions. Signed-off-by: kdrag0n <dragon@khronodragon.com>
1 parent 38e7628 commit 2e8cd82

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kernel/sched/tune.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,10 @@ boost_write(struct cgroup_subsys_state *css, struct cftype *cft,
837837

838838
if (boost < -100 || boost > 100)
839839
return -EINVAL;
840+
841+
if (boost <= 10)
842+
boost = 0;
843+
840844
boost_pct = boost;
841845

842846
/*

0 commit comments

Comments
 (0)