diff options
author | Chris Redpath <chris.redpath@arm.com> | 2014-08-12 14:50:54 +0100 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2014-08-12 17:46:57 +0100 |
commit | f83262408293795e5186e9d1bf66d525b24fdb12 (patch) | |
tree | 2a4cb0856459aad5c54c29e78ae7decb8801a75e /include/linux | |
parent | 65abdc9b50378783981ed2f3453a0aae090404e4 (diff) |
HMP: Do not fork-boost tasks coming from PIDs <= 2
System services are generally started by init, whilst kernel threads
are started by kthreadd. We do not want to give those tasks a head
start, as this costs power for very little benefit. We do however
wish to do that for tasks which the user launches.
Further, some tasks allocate per-cpu timers directly after launch
which can lead to those tasks being always scheduled on a big CPU
when there is no computational need to do so. Not promoting services
to big CPUs on launch will prevent that unless a service allocates
their per-cpu resources after a period of intense computation, which
is not a common pattern.
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sched.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 0e2a546cdade..b36dd2de437d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -946,6 +946,14 @@ struct sched_avg { u32 usage_avg_sum; }; +#ifdef CONFIG_SCHED_HMP +/* + * We want to avoid boosting any processes forked from init (PID 1) + * and kthreadd (assumed to be PID 2). + */ +#define hmp_task_should_forkboost(task) ((task->parent && task->parent->pid > 2)) +#endif + #ifdef CONFIG_SCHEDSTATS struct sched_statistics { u64 wait_start; |