mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
sched/walt: remove duplicate definitions of rt_task_arrival_time
rt_task_arrival_time is being defined in a header as well as in a source file which is incorrect, fix it by changing definition to declaration in header. While at it, clean-up related code and make sure long running RT detection happens for FIFO sched class only. Change-Id: Ia9f227ad3af0059d354eb0e4df3ab719c1348ac5 Signed-off-by: Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>
This commit is contained in:
parent
d6ad86a43e
commit
bb7363e104
|
|
@ -4334,7 +4334,7 @@ static void walt_do_sched_yield(void *unused, struct rq *rq)
|
|||
if (mvp_prio != WALT_NOT_MVP)
|
||||
walt_cfs_deactivate_mvp_task(curr);
|
||||
|
||||
if (rt_task(curr))
|
||||
if (per_cpu(rt_task_arrival_time, cpu_of(rq)))
|
||||
per_cpu(rt_task_arrival_time, cpu_of(rq)) = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -886,11 +886,6 @@ static inline bool walt_fair_task(struct task_struct *p)
|
|||
return p->prio >= MAX_RT_PRIO && !is_idle_task(p);
|
||||
}
|
||||
|
||||
extern void rt_task_arrival_marker(void *unused, bool preempt,
|
||||
struct task_struct *prev, struct task_struct *next);
|
||||
|
||||
extern void long_running_rt_task_notifier(void *unused, struct rq *rq);
|
||||
|
||||
extern int sched_long_running_rt_task_ms_handler(struct ctl_table *table, int write,
|
||||
void __user *buffer, size_t *lenp,
|
||||
loff_t *ppos);
|
||||
|
|
@ -936,7 +931,7 @@ 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);
|
||||
DECLARE_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);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
#define MSEC_TO_NSEC (1000 * 1000)
|
||||
|
||||
static DEFINE_PER_CPU(cpumask_var_t, walt_local_cpu_mask);
|
||||
DEFINE_PER_CPU(u64, rt_task_arrival_time);
|
||||
DEFINE_PER_CPU(u64, rt_task_arrival_time) = 0;
|
||||
static bool long_running_rt_task_trace_rgstrd;
|
||||
|
||||
void rt_task_arrival_marker(void *unused, bool preempt,
|
||||
static void rt_task_arrival_marker(void *unused, bool preempt,
|
||||
struct task_struct *prev, struct task_struct *next)
|
||||
{
|
||||
unsigned int cpu = raw_smp_processor_id();
|
||||
|
|
@ -26,7 +26,7 @@ void rt_task_arrival_marker(void *unused, bool preempt,
|
|||
per_cpu(rt_task_arrival_time, cpu) = 0;
|
||||
}
|
||||
|
||||
void long_running_rt_task_notifier(void *unused, struct rq *rq)
|
||||
static void long_running_rt_task_notifier(void *unused, struct rq *rq)
|
||||
{
|
||||
struct task_struct *curr = rq->curr;
|
||||
unsigned int cpu = raw_smp_processor_id();
|
||||
|
|
@ -37,6 +37,19 @@ void long_running_rt_task_notifier(void *unused, struct rq *rq)
|
|||
if (!per_cpu(rt_task_arrival_time, cpu))
|
||||
return;
|
||||
|
||||
if (per_cpu(rt_task_arrival_time, cpu) && curr->policy != SCHED_FIFO) {
|
||||
/* This should never happen, trying to avoid any false positives */
|
||||
printk_deferred("Long running RT false positive detected for task %s (%d) runtime > %u now=%llu task arrival time=%llu runtime=%llu\n",
|
||||
curr->comm, curr->pid,
|
||||
sysctl_sched_long_running_rt_task_ms * MSEC_TO_NSEC,
|
||||
rq_clock_task(rq),
|
||||
per_cpu(rt_task_arrival_time, cpu),
|
||||
rq_clock_task(rq) -
|
||||
per_cpu(rt_task_arrival_time, cpu));
|
||||
per_cpu(rt_task_arrival_time, cpu) = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (rq_clock_task(rq) -
|
||||
per_cpu(rt_task_arrival_time, cpu)
|
||||
> sysctl_sched_long_running_rt_task_ms * MSEC_TO_NSEC) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user