From 8b165b0bc14491af94df2ed215b4baebedda74ee Mon Sep 17 00:00:00 2001 From: kondors1995 Date: Fri, 11 Sep 2020 09:40:30 +0000 Subject: [PATCH] treewide: remove blocker changes Squashed commit of the following: commit 811cf86e5630b6683e461e5ee456d4ffe2eb36b2 Author: kondors1995 Date: Wed Sep 9 07:21:29 2020 +0000 Revert "cpufreq: schedutil: Apply init protection to default configuration options" This reverts commit 4ecb29c3df2c8ae132da41887656921d2decb882. commit b541ba1f2b0543761d962d36380f04139becf16a Author: kondors1995 Date: Wed Sep 9 07:08:13 2020 +0000 Revert "kernel: introduce CPUSets Assist" This reverts commit c45e65572c57b290cb62a6217a7afef76cbe74df. commit 886a836d499dd2a19b93f08be7e68f6f6baa2e6b Author: kondors1995 Date: Wed Sep 9 07:08:03 2020 +0000 Revert "cpuset: Refactor cpuset assist code" This reverts commit 04eada3a892e129f7a381f0cc64d1971d28c21fe. commit 9bdcbf7576aabdea6639e98d576cf63f8804f6d6 Author: kondors1995 Date: Wed Sep 9 07:07:57 2020 +0000 Revert "cpuset: Move cpuset override values to Kconfig" This reverts commit edbf67e1993a603119ee49c62a6c0d8099ad953c. commit f9a4600e0bc63e7ea2bdc3a23ef3e1e1848f5d56 Author: kondors1995 Date: Wed Sep 9 07:07:51 2020 +0000 Revert "cpuset: guard CPUSETS_ASSISTANT code properly" This reverts commit 068236c13af2384e786a814c4945869c9bac4ffc. commit adf6f1f9c99161593af8c88f9875730823ece72c Author: kondors1995 Date: Wed Sep 9 07:06:39 2020 +0000 Revert "exec: Add node tampering blacklist function" This reverts commit ce392dfd954959ff087f164befb048eaa252cafa. commit a8c8bf6cd51e6c1eaf2c533604aa9672ea3e605f Author: kondors1995 Date: Wed Sep 9 07:06:32 2020 +0000 Revert "exec: Extend task_is_booster check to cover OxygenOS userspace HALs" This reverts commit 9e18f0f5569da985b3e85b4277366222d9abe4bb. commit 49f0c5e402345ec5d25a46a573de09d967a3d298 Author: kondors1995 Date: Wed Sep 9 07:06:25 2020 +0000 Revert "exec: Add power@2.0 and IOP to tampering blacklist" This reverts commit a94abe8d8eabe6b593399b5596181da329386cea. commit df04db7ce215e1b90559bdfd59a7cc7b0a3128c1 Author: kondors1995 Date: Wed Sep 9 07:02:19 2020 +0000 Revert "cpufreq: Kill userspace CPU boosting entirely" This reverts commit 3588cb8f72a4ea39417dc2b0d7a1807d442f43e5. commit b56ca8721a22b3f0ce870485084578de6d2e4bf1 Author: kondors1995 Date: Wed Sep 9 07:01:59 2020 +0000 Revert "cpufreq: Allow configuring default minimum frequencies in Kconfig" This reverts commit c52d0b68a4c1bf1a40694c323c514bf9af3c63c4. commit 3683571e22dec49b2e9585c9bf67e26c3f90c62d Author: kondors1995 Date: Wed Sep 9 07:01:52 2020 +0000 Revert "cpufreq: schedutil: Expose default rate-limits as config options" This reverts commit 8e639c1f3ff7ec34d127b4c060be6d6916e1acd4. --- drivers/cpufreq/Kconfig | 45 -------------------------- drivers/cpufreq/cpufreq.c | 3 -- drivers/cpufreq/freq_table.c | 13 -------- include/linux/binfmts.h | 15 --------- init/Kconfig | 55 -------------------------------- kernel/cgroup/cpuset.c | 54 ++----------------------------- kernel/sched/cpufreq_schedutil.c | 14 ++------ 7 files changed, 5 insertions(+), 194 deletions(-) diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index db8c2890accd..6cfaaeb2e79a 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig @@ -230,24 +230,6 @@ config CPU_FREQ_GOV_SCHEDUTIL If in doubt, say N. -if CPU_FREQ_GOV_SCHEDUTIL - -config SCHEDUTIL_UP_RATE_LIMIT - int "Default up rate-limit for schedutil" - default 1000 - help - This sets schedutil's default frequency up rate-limit in - microseconds. - -config SCHEDUTIL_DOWN_RATE_LIMIT - int "Default down rate-limit for schedutil" - default 1000 - help - This sets schedutil's default frequency down rate-limit in - microseconds. - -endif - config CPU_FREQ_GOV_INTERACTIVE tristate "'interactive' cpufreq policy governor" depends on CPU_FREQ @@ -268,33 +250,6 @@ config CPU_FREQ_GOV_INTERACTIVE If in doubt, say N. -config CPU_FREQ_DEFAULT_LITTLE_MIN - int "Default minimum frequency for the little cluster" - default 0 - help - This sets the default minimum frequency (in kHz) for the little CPU - cluster. - - If in doubt, say 0 to use the hardware's minimum frequency. - -config CPU_FREQ_DEFAULT_BIG_MIN - int "Default minimum frequency for the big cluster" - default 0 - help - This sets the default minimum frequency (in kHz) for the big CPU - cluster. - - If in doubt, say 0 to use the hardware's minimum frequency. - -config CPU_FREQ_DEFAULT_PRIME_MIN - int "Default minimum frequency for the prime cluster" - default 0 - help - This sets the default minimum frequency (in kHz) for the prime CPU - cluster. - - If in doubt, say 0 to use the hardware's minimum frequency. - comment "CPU frequency scaling drivers" config CPUFREQ_DT diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index db33268b47fa..a9c484519369 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -727,9 +727,6 @@ static ssize_t store_##file_name \ int ret, temp; \ struct cpufreq_policy new_policy; \ \ - if (&policy->object == &policy->min) \ - return count; \ - \ memcpy(&new_policy, policy, sizeof(*policy)); \ new_policy.min = policy->user_policy.min; \ new_policy.max = policy->user_policy.max; \ diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index 060b5c03ea9c..7f205ec61244 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -61,19 +61,6 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, if (max_freq > cpuinfo_max_freq_cached) cpuinfo_max_freq_cached = max_freq; -#if CONFIG_CPU_FREQ_DEFAULT_LITTLE_MIN - if (cpumask_test_cpu(policy->cpu, cpu_lp_mask)) - policy->min = CONFIG_CPU_FREQ_DEFAULT_LITTLE_MIN; -#endif -#if CONFIG_CPU_FREQ_DEFAULT_BIG_MIN - if (cpumask_test_cpu(policy->cpu, cpu_perf_mask)) - policy->min = CONFIG_CPU_FREQ_DEFAULT_BIG_MIN; -#endif -#if CONFIG_CPU_FREQ_DEFAULT_PRIME_MIN - if (cpumask_test_cpu(policy->cpu, cpu_perfp_mask)) - policy->min = CONFIG_CPU_FREQ_DEFAULT_PRIME_MIN; -#endif - if (policy->min == ~0) return -EINVAL; else diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index ef6f37c7ed39..b0abe21d6cc9 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h @@ -148,19 +148,4 @@ extern int do_execveat(int, struct filename *, const char __user * const __user *, int); -static inline bool task_is_booster(struct task_struct *tsk) -{ - char comm[sizeof(tsk->comm)]; - - get_task_comm(comm, tsk); - return !strcmp(comm, "init") || !strcmp(comm, "NodeLooperThrea") || - !strcmp(comm, "power@1.2-servi") || - !strcmp(comm, "power@1.3-servi") || - !strcmp(comm, "perf@1.0-servic") || - !strcmp(comm, "perf@2.0-servic") || - !strcmp(comm, "power@2.0-servic") || - !strcmp(comm, "iop@") || - !strcmp(comm, "init.qcom.post_"); -} - #endif /* _LINUX_BINFMTS_H */ diff --git a/init/Kconfig b/init/Kconfig index 16ccb418ca32..a3dd8e273713 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1123,61 +1123,6 @@ config SCHED_TUNE If unsure, say N. -config CPUSETS_ASSIST - bool "Cpuset configuration helper" - depends on CPUSETS - depends on ANDROID - help - This option enables in-kernel overrides for cpuset values. - - If unsure, say N. - -if CPUSETS_ASSIST - -config CPUSET_AUDIO_APP - string "Value for 'audio-app' cpuset" - default "1-2" - help - The CPU mask to use for the audio-app cpuset. - -config CPUSET_BG - string "Value for 'background' cpuset" - default "0-3" - help - The CPU mask to use for the audio-app cpuset. - -config CPUSET_CAMERA - string "Value for 'camera-daemon' cpuset" - default "4-7" - help - The CPU mask to use for the audio-app cpuset. - -config CPUSET_FG - string "Value for 'foreground' cpuset" - default "0-7" - help - The CPU mask to use for the audio-app cpuset. - -config CPUSET_RESTRICTED - string "Value for 'restricted' cpuset" - default "0-7" - help - The CPU mask to use for the audio-app cpuset. - -config CPUSET_SYSTEM_BG - string "Value for 'system-background' cpuset" - default "0-3" - help - The CPU mask to use for the audio-app cpuset. - -config CPUSET_TOP_APP - string "Value for 'top-app' cpuset" - default "0-7" - help - The CPU mask to use for the audio-app cpuset. - -endif - config DEFAULT_USE_ENERGY_AWARE bool "Default to enabling the Energy Aware Scheduler feature" default n diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 84e3543548cc..f6989f24c80c 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -57,7 +57,6 @@ #include #include #include -#include #include #include @@ -138,13 +137,6 @@ struct cpuset { int relax_domain_level; }; -#ifdef CONFIG_CPUSETS_ASSIST -struct cs_target { - const char *name; - char *cpus; -}; -#endif - static inline struct cpuset *css_cs(struct cgroup_subsys_state *css) { return css ? container_of(css, struct cpuset, css) : NULL; @@ -1721,6 +1713,8 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, struct cpuset *trialcs; int retval = -ENODEV; + buf = strstrip(buf); + /* * CPU or memory hotunplug may leave @cs w/o any execution * resources, in which case the hotplug code asynchronously updates @@ -1775,48 +1769,6 @@ out_unlock: return retval ?: nbytes; } -#ifdef CONFIG_CPUSETS_ASSIST -static ssize_t cpuset_write_resmask_assist(struct kernfs_open_file *of, - struct cs_target tgt, size_t nbytes, - loff_t off) -{ - pr_info("cpuset_assist: setting %s to %s\n", tgt.name, tgt.cpus); - return cpuset_write_resmask(of, tgt.cpus, nbytes, off); -} -#endif - -static ssize_t cpuset_write_resmask_wrapper(struct kernfs_open_file *of, - char *buf, size_t nbytes, loff_t off) -{ -#ifdef CONFIG_CPUSETS_ASSIST - static struct cs_target cs_targets[] = { - { "audio-app", CONFIG_CPUSET_AUDIO_APP }, - { "background", CONFIG_CPUSET_BG }, - { "camera-daemon", CONFIG_CPUSET_CAMERA }, - { "foreground", CONFIG_CPUSET_FG }, - { "restricted", CONFIG_CPUSET_RESTRICTED }, - { "system-background", CONFIG_CPUSET_SYSTEM_BG }, - { "top-app", CONFIG_CPUSET_TOP_APP }, - }; - struct cpuset *cs = css_cs(of_css(of)); - int i; - - if (task_is_booster(current)) { - for (i = 0; i < ARRAY_SIZE(cs_targets); i++) { - struct cs_target tgt = cs_targets[i]; - - if (!strcmp(cs->css.cgroup->kn->name, tgt.name)) - return cpuset_write_resmask_assist(of, tgt, - nbytes, off); - } - } -#endif - - buf = strstrip(buf); - - return cpuset_write_resmask(of, buf, nbytes, off); -} - /* * These ascii lists should be read in a single call, by using a user * buffer large enough to hold the entire map. If read in smaller @@ -1909,7 +1861,7 @@ static struct cftype files[] = { { .name = "cpus", .seq_show = cpuset_common_seq_show, - .write = cpuset_write_resmask_wrapper, + .write = cpuset_write_resmask, .max_write_len = (100U + 6 * NR_CPUS), .private = FILE_CPULIST, }, diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 6dc39362cbef..568605c11d8d 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -11,7 +11,6 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include #include #include #include @@ -686,9 +685,6 @@ static ssize_t up_rate_limit_us_store(struct gov_attr_set *attr_set, struct sugov_policy *sg_policy; unsigned int rate_limit_us; - if (task_is_booster(current)) - return count; - if (kstrtouint(buf, 10, &rate_limit_us)) return -EINVAL; @@ -709,9 +705,6 @@ static ssize_t down_rate_limit_us_store(struct gov_attr_set *attr_set, struct sugov_policy *sg_policy; unsigned int rate_limit_us; - if (task_is_booster(current)) - return count; - if (kstrtouint(buf, 10, &rate_limit_us)) return -EINVAL; @@ -739,9 +732,6 @@ static ssize_t iowait_boost_enable_store(struct gov_attr_set *attr_set, struct sugov_tunables *tunables = to_sugov_tunables(attr_set); bool enable; - if (task_is_booster(current)) - return count; - if (kstrtobool(buf, &enable)) return -EINVAL; @@ -1058,9 +1048,9 @@ static int sugov_init(struct cpufreq_policy *policy) } tunables->up_rate_limit_us = - CONFIG_SCHEDUTIL_UP_RATE_LIMIT; + cpufreq_policy_transition_delay_us(policy); tunables->down_rate_limit_us = - CONFIG_SCHEDUTIL_DOWN_RATE_LIMIT; + cpufreq_policy_transition_delay_us(policy); tunables->hispeed_load = DEFAULT_HISPEED_LOAD; tunables->hispeed_freq = 0; tunables->iowait_boost_enable = true;