Skip to content

Commit

Permalink
Revert "dynamic stune boost to 4.19 patch squashed #1"
Browse files Browse the repository at this point in the history
This reverts commit 1f5447b.
  • Loading branch information
acuicultor committed Feb 12, 2021
1 parent c30455b commit 7ff6d6b
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 437 deletions.
68 changes: 0 additions & 68 deletions drivers/cpufreq/cpu-boost.c
Expand Up @@ -61,23 +61,6 @@ cpu_boost_attr_rw(sched_boost_on_input);

static bool sched_boost_active;

#ifdef CONFIG_DYNAMIC_STUNE_BOOST
static int dynamic_stune_boost;
show_one(dynamic_stune_boost);
store_one(dynamic_stune_boost);
cpu_boost_attr_rw(dynamic_stune_boost);

static bool stune_boost_active;
static int boost_slot;

static unsigned int dynamic_stune_boost_ms = 40;
show_one(dynamic_stune_boost_ms);
store_one(dynamic_stune_boost_ms);
cpu_boost_attr_rw(dynamic_stune_boost_ms);

static struct delayed_work dynamic_stune_boost_rem;
#endif /* CONFIG_DYNAMIC_STUNE_BOOST */

static struct delayed_work input_boost_rem;
static u64 last_input_time;

Expand Down Expand Up @@ -229,42 +212,19 @@ static void do_input_boost_rem(struct work_struct *work)
}
}

#ifdef CONFIG_DYNAMIC_STUNE_BOOST
static void do_dynamic_stune_boost_rem(struct work_struct *work)
{
/* Reset dynamic stune boost value to the default value */
if (stune_boost_active) {
reset_stune_boost("top-app", boost_slot);
stune_boost_active = false;
}
}
#endif /* CONFIG_DYNAMIC_STUNE_BOOST */

static void do_input_boost(struct work_struct *work)
{
unsigned int i, ret;
struct cpu_sync *i_sync_info;

#ifdef CONFIG_DYNAMIC_STUNE_BOOST
cancel_delayed_work_sync(&dynamic_stune_boost_rem);
#endif /* CONFIG_DYNAMIC_STUNE_BOOST */

if (!input_boost_ms)
return;

cancel_delayed_work_sync(&input_boost_rem);
if (sched_boost_active) {
sched_set_boost(0);
sched_boost_active = false;
}

#ifdef CONFIG_DYNAMIC_STUNE_BOOST
if (stune_boost_active) {
reset_stune_boost("top-app", boost_slot);
stune_boost_active = false;
}
#endif /* CONFIG_DYNAMIC_STUNE_BOOST */

/* Set the input_boost_min for all CPUs in the system */
pr_debug("Setting input boost min for all CPUs\n");
for_each_possible_cpu(i) {
Expand All @@ -284,16 +244,6 @@ static void do_input_boost(struct work_struct *work)
sched_boost_active = true;
}

#ifdef CONFIG_DYNAMIC_STUNE_BOOST
/* Set dynamic stune boost value */
ret = do_stune_boost("top-app", dynamic_stune_boost, &boost_slot);
if (!ret)
stune_boost_active = true;

queue_delayed_work(cpu_boost_wq, &dynamic_stune_boost_rem,
msecs_to_jiffies(dynamic_stune_boost_ms));
#endif /* CONFIG_DYNAMIC_STUNE_BOOST */

queue_delayed_work(cpu_boost_wq, &input_boost_rem,
msecs_to_jiffies(input_boost_ms));
}
Expand Down Expand Up @@ -349,11 +299,6 @@ static int cpuboost_input_connect(struct input_handler *handler,

static void cpuboost_input_disconnect(struct input_handle *handle)
{
#ifdef CONFIG_DYNAMIC_STUNE_BOOST
/* Reset dynamic stune boost value to the default value */
reset_stune_boost("top-app", boost_slot);
#endif /* CONFIG_DYNAMIC_STUNE_BOOST */

input_close_device(handle);
input_unregister_handle(handle);
kfree(handle);
Expand Down Expand Up @@ -405,9 +350,6 @@ static int cpu_boost_init(void)

INIT_WORK(&input_boost_work, do_input_boost);
INIT_DELAYED_WORK(&input_boost_rem, do_input_boost_rem);
#ifdef CONFIG_DYNAMIC_STUNE_BOOST
INIT_DELAYED_WORK(&dynamic_stune_boost_rem, do_dynamic_stune_boost_rem);
#endif /* CONFIG_DYNAMIC_STUNE_BOOST */

for_each_possible_cpu(cpu) {
s = &per_cpu(sync_info, cpu);
Expand All @@ -433,16 +375,6 @@ static int cpu_boost_init(void)
if (ret)
pr_err("Failed to create sched_boost_on_input node: %d\n", ret);

#ifdef CONFIG_DYNAMIC_STUNE_BOOST
ret = sysfs_create_file(cpu_boost_kobj, &dynamic_stune_boost_attr.attr);
if (ret)
pr_err("Failed to create dynamic_stune_boost node: %d\n", ret);

ret = sysfs_create_file(cpu_boost_kobj, &dynamic_stune_boost_ms_attr.attr);
if (ret)
pr_err("Failed to create dynamic_stune_boost_ms node: %d\n", ret);
#endif /* CONFIG_DYNAMIC_STUNE_BOOST */

ret = input_register_handler(&cpuboost_input_handler);
return 0;
}
Expand Down
6 changes: 0 additions & 6 deletions include/linux/sched.h
Expand Up @@ -2419,10 +2419,4 @@ static inline void task_tli_init(struct task_struct *cur)
}
#endif

#ifdef CONFIG_DYNAMIC_STUNE_BOOST
int do_stune_boost(char *st_name, int boost, int *slot);
int do_stune_sched_boost(char *st_name, int *slot);
int reset_stune_boost(char *st_name, int slot);
#endif /* CONFIG_DYNAMIC_STUNE_BOOST */

#endif
9 changes: 0 additions & 9 deletions init/Kconfig
Expand Up @@ -1196,15 +1196,6 @@ config SCHED_TUNE

If unsure, say N.

config DYNAMIC_STUNE_BOOST
bool "Dynamic SchedTune boosting support"
depends on SCHED_TUNE
help
This option extends the SchedTune framework and provides APIs to
activate and reset SchedTune boosting from anywhere in the kernel.

If unsure, say N.

config CPUSET_ASSIST
bool "Cpuset configuration helper"
depends on CPUSETS
Expand Down
12 changes: 0 additions & 12 deletions kernel/sched/boost.c
Expand Up @@ -9,10 +9,6 @@
#include <linux/sched/core_ctl.h>
#include <trace/events/sched.h>

#ifdef CONFIG_DYNAMIC_STUNE_BOOST
static int boost_slot;
#endif // CONFIG_DYNAMIC_STUNE_BOOST

/*
* Scheduler boost is a mechanism to temporarily place tasks on CPUs
* with higher capacity than those where a task would have normally
Expand Down Expand Up @@ -211,14 +207,6 @@ static void sched_boost_disable_all(void)

static void _sched_set_boost(int type)
{

#ifdef CONFIG_DYNAMIC_STUNE_BOOST
if (type > 0)
do_stune_sched_boost("top-app", &boost_slot);
else
reset_stune_boost("top-app", boost_slot);
#endif // CONFIG_DYNAMIC_STUNE_BOOST

if (type == 0)
sched_boost_disable_all();
else if (type > 0)
Expand Down

0 comments on commit 7ff6d6b

Please sign in to comment.