Re: [STABLE] kernel oops which can be fixed by peterz's patches

From: Ben Hutchings
Date: Tue Feb 23 2016 - 16:07:16 EST


On Wed, 2016-02-17 at 04:02 +0100, Mike Galbraith wrote:
[...]

@stable: Kernels that predate SCHED_DEADLINE can use this simple (and tested)
check in lieu of backport of the full 18 patch mainline treatment.

Signed-off-by: Mike Galbraith <umgwanakikbuti@xxxxxxxxx>
---
Âkernel/sched/fair.c |ÂÂÂÂ9 +++++++++
Â1 file changed, 9 insertions(+)

--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4008,6 +4008,7 @@ int can_migrate_task(struct task_struct
 Â* 2) cannot be migrated to this CPU due to cpus_allowed, or
 Â* 3) running (obviously), or
 Â* 4) are cache-hot on their current CPU.
+ Â* 5) p->pi_lock is held.
 Â*/
 if (throttled_lb_pair(task_group(p), env->src_cpu, env->dst_cpu))
 return 0;
@@ -4049,6 +4050,14 @@ int can_migrate_task(struct task_struct
 }
Â
 /*
+ Â* rt -> fair class change may be in progress.ÂÂIf we sneak in should
+ Â* double_lock_balance() release rq->lock, and move the task, we will
+ Â* cause switched_to_fair() to meet a passed but no longer valid rq.
+ Â*/
+ if (raw_spin_is_locked(&p->pi_lock))
+ return 0;
+
+ /*
 Â* Aggressive migration if:
 Â* 1) task is cache cold, or
 Â* 2) too many balance attempts have failed.



Queued up for 3.2, thanks.

Ben.

--
Ben Hutchings
Any smoothly functioning technology is indistinguishable from a rigged demo.
--
Ben Hutchings
Any smoothly functioning technology is indistinguishable from a rigged demo.

Attachment: signature.asc
Description: This is a digitally signed message part