[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190725070857.6639-4-parth@linux.ibm.com>
Date: Thu, 25 Jul 2019 12:38:52 +0530
From: Parth Shah <parth@...ux.ibm.com>
To: peterz@...radead.org, mingo@...hat.com
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
patrick.bellasi@....com, dietmar.eggemann@....com,
daniel.lezcano@...aro.org, subhra.mazumdar@...cle.com
Subject: [RFC v4 3/8] sched/core: Update turbo_sched count only when required
Use the get/put methods to add/remove the use of TurboSched support, such
that the feature is turned on only if there is atleast one jitter task.
Signed-off-by: Parth Shah <parth@...ux.ibm.com>
---
kernel/sched/core.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ee5980b4e150..60340fa18abb 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3141,6 +3141,9 @@ static struct rq *finish_task_switch(struct task_struct *prev)
mmdrop(mm);
}
if (unlikely(prev_state == TASK_DEAD)) {
+ if (unlikely(prev->flags & PF_CAN_BE_PACKED))
+ turbo_sched_put();
+
if (prev->sched_class->task_dead)
prev->sched_class->task_dead(prev);
@@ -4793,6 +4796,10 @@ static int __sched_setscheduler(struct task_struct *p,
prev_class = p->sched_class;
+ /* Refcount tasks classified as jitter task */
+ if (task_packing_flag != (p->flags & PF_CAN_BE_PACKED))
+ (task_packing_flag) ? turbo_sched_get() : turbo_sched_put();
+
__setscheduler(rq, p, attr, pi);
__setscheduler_uclamp(p, attr);
--
2.17.1
Powered by blists - more mailing lists