mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
sched/walt: Add yield case to LRRT task detection
Reset the arrival time of the RT task when task yields. This way, time spent during and after yield is not conidered towards RT task runtime. Change-Id: I8f961bca1ee7bac67dafa0238594fc4a444fdcd1 Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
This commit is contained in:
parent
b2f69d86bb
commit
851ffc330b
|
|
@ -4315,6 +4315,19 @@ static void android_rvh_build_perf_domains(void *unused, bool *eas_check)
|
|||
*eas_check = true;
|
||||
}
|
||||
|
||||
static void walt_do_sched_yield(void *unused, struct rq *rq)
|
||||
{
|
||||
struct task_struct *curr = rq->curr;
|
||||
int mvp_prio = walt_get_mvp_task_prio(curr);
|
||||
|
||||
lockdep_assert_held(&rq->__lock);
|
||||
if (mvp_prio != WALT_NOT_MVP)
|
||||
walt_cfs_deactivate_mvp_task(curr);
|
||||
|
||||
if (rt_task(curr))
|
||||
per_cpu(rt_task_arrival_time, cpu_of(rq)) = 0;
|
||||
}
|
||||
|
||||
static void register_walt_hooks(void)
|
||||
{
|
||||
register_trace_android_rvh_wake_up_new_task(android_rvh_wake_up_new_task, NULL);
|
||||
|
|
@ -4342,6 +4355,7 @@ static void register_walt_hooks(void)
|
|||
register_trace_android_rvh_sched_exec(android_rvh_sched_exec, NULL);
|
||||
register_trace_android_rvh_build_perf_domains(android_rvh_build_perf_domains, NULL);
|
||||
register_trace_cpu_frequency_limits(walt_cpu_frequency_limits, NULL);
|
||||
register_trace_android_rvh_do_sched_yield(walt_do_sched_yield, NULL);
|
||||
}
|
||||
|
||||
atomic64_t walt_irq_work_lastq_ws;
|
||||
|
|
|
|||
|
|
@ -936,6 +936,10 @@ extern int in_sched_bug;
|
|||
extern struct rq *__migrate_task(struct rq *rq, struct rq_flags *rf,
|
||||
struct task_struct *p, int dest_cpu);
|
||||
|
||||
extern DEFINE_PER_CPU(u64, rt_task_arrival_time);
|
||||
extern int walt_get_mvp_task_prio(struct task_struct *p);
|
||||
extern void walt_cfs_deactivate_mvp_task(struct task_struct *p);
|
||||
|
||||
enum WALT_DEBUG_FEAT {
|
||||
WALT_BUG_UPSTREAM,
|
||||
WALT_BUG_WALT,
|
||||
|
|
|
|||
|
|
@ -1018,7 +1018,7 @@ static void binder_restore_priority_hook(void *data,
|
|||
* they can preempt long running rtg prio tasks but binders loose their
|
||||
* powers with in 3 msec where as rtg prio tasks can run more than that.
|
||||
*/
|
||||
static inline int walt_get_mvp_task_prio(struct task_struct *p)
|
||||
int walt_get_mvp_task_prio(struct task_struct *p)
|
||||
{
|
||||
if (per_task_boost(p) == TASK_BOOST_STRICT_MAX)
|
||||
return WALT_TASK_BOOST_MVP;
|
||||
|
|
@ -1065,7 +1065,7 @@ static void walt_cfs_insert_mvp_task(struct walt_rq *wrq, struct walt_task_struc
|
|||
list_add(&wts->mvp_list, pos->prev);
|
||||
}
|
||||
|
||||
static void walt_cfs_deactivate_mvp_task(struct task_struct *p)
|
||||
void walt_cfs_deactivate_mvp_task(struct task_struct *p)
|
||||
{
|
||||
struct walt_task_struct *wts = (struct walt_task_struct *) p->android_vendor_data1;
|
||||
|
||||
|
|
@ -1132,16 +1132,6 @@ static void walt_cfs_account_mvp_runtime(struct rq *rq, struct task_struct *curr
|
|||
walt_cfs_insert_mvp_task(wrq, wts, false);
|
||||
}
|
||||
|
||||
static void walt_cfs_mvp_do_sched_yield(void *unused, struct rq *rq)
|
||||
{
|
||||
struct task_struct *curr = rq->curr;
|
||||
int mvp_prio = walt_get_mvp_task_prio(curr);
|
||||
|
||||
lockdep_assert_held(&rq->__lock);
|
||||
if (mvp_prio != WALT_NOT_MVP)
|
||||
walt_cfs_deactivate_mvp_task(curr);
|
||||
}
|
||||
|
||||
void walt_cfs_enqueue_task(struct rq *rq, struct task_struct *p)
|
||||
{
|
||||
struct walt_rq *wrq = (struct walt_rq *) rq->android_vendor_data1;
|
||||
|
|
@ -1349,6 +1339,4 @@ void walt_cfs_init(void)
|
|||
|
||||
register_trace_android_rvh_check_preempt_wakeup(walt_cfs_check_preempt_wakeup, NULL);
|
||||
register_trace_android_rvh_replace_next_task_fair(walt_cfs_replace_next_task_fair, NULL);
|
||||
|
||||
register_trace_android_rvh_do_sched_yield(walt_cfs_mvp_do_sched_yield, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#define MSEC_TO_NSEC (1000 * 1000)
|
||||
|
||||
static DEFINE_PER_CPU(cpumask_var_t, walt_local_cpu_mask);
|
||||
static DEFINE_PER_CPU(u64, rt_task_arrival_time);
|
||||
DEFINE_PER_CPU(u64, rt_task_arrival_time);
|
||||
static bool long_running_rt_task_trace_rgstrd;
|
||||
|
||||
void rt_task_arrival_marker(void *unused, bool preempt,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user