mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
sched/walt: skip long running RT task detection for stopper tasks
As stopper task's scheduling policy is set to FIFO and task may run
long time depends on the number of tasks to be migrated etc., current
long running RT task detection feature crashes system due to task's
arrivial time stamp is taken when stopper task scheduled in during
CPU hot-plug out operation and used it later when CPU gets hot-plugged
in back.
Fix this false positive issue by skipping update of arrivial time stamp
for stopper tasks.
Fixes: b429bee50fe2c8f ("sched/walt/rt: limit long running RT task detection to FIFO")
Change-Id: I714494fee49b6e8e5d50885bd47b38ad0d535579
Signed-off-by: Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>
This commit is contained in:
parent
affc93eb8a
commit
68dfacdb44
|
|
@ -20,7 +20,7 @@ static void rt_task_arrival_marker(void *unused, bool preempt,
|
|||
{
|
||||
unsigned int cpu = raw_smp_processor_id();
|
||||
|
||||
if (next->policy == SCHED_FIFO)
|
||||
if (next->policy == SCHED_FIFO && next != cpu_rq(cpu)->stop)
|
||||
per_cpu(rt_task_arrival_time, cpu) = rq_clock_task(this_rq());
|
||||
else
|
||||
per_cpu(rt_task_arrival_time, cpu) = 0;
|
||||
|
|
@ -38,14 +38,12 @@ static void long_running_rt_task_notifier(void *unused, struct rq *rq)
|
|||
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));
|
||||
/*
|
||||
* It is possible that the scheduling policy for the current
|
||||
* task might get changed after task arrival time stamp is
|
||||
* noted during sched_switch of RT task. To avoid such false
|
||||
* positives, reset arrival time stamp.
|
||||
*/
|
||||
per_cpu(rt_task_arrival_time, cpu) = 0;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user