[patch] rt,workqueue: Fix blocking call when !TASK_RUNNING splat in rescuer_thread()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[    0.221225] ------------[ cut here ]------------
[    0.221241] WARNING: CPU: 1 PID: 69 at kernel/sched/core.c:7733 __might_sleep+0x7f/0x90()
[    0.221253] do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffff8106edc4>] rescuer_thread+0x64/0x340
[    0.221263] Modules linked in:
[    0.221272] CPU: 1 PID: 69 Comm: khelper Not tainted 4.0.0-rt4-lockdep #71
[    0.221273] Hardware name: IBM System x3550 M3 -[7944K3G]-/69Y5698     , BIOS -[D6E150AUS-1.10]- 12/15/2010
[    0.221280]  ffffffff81a2269f ffff8801789a7cc8 ffffffff81605182 0000000000000002
[    0.221282]  ffff8801789a7d18 ffff8801789a7d08 ffffffff81053cda ffff8801789a7d48
[    0.221284]  ffffffff81a23b44 0000000000000394 0000000000000000 0000000000000000
[    0.221284] Call Trace:
[    0.221288]  [<ffffffff81605182>] dump_stack+0x4f/0x9d
[    0.221291]  [<ffffffff81053cda>] warn_slowpath_common+0x8a/0xe0
[    0.221293]  [<ffffffff81053d76>] warn_slowpath_fmt+0x46/0x50
[    0.221295]  [<ffffffff8106edc4>] ? rescuer_thread+0x64/0x340 
[    0.221296]  [<ffffffff8106edc4>] ? rescuer_thread+0x64/0x340
[    0.221298]  [<ffffffff810794ef>] __might_sleep+0x7f/0x90
[    0.221299]  [<ffffffff8106ed60>] ? worker_thread+0x4d0/0x4d0
[    0.221301]  [<ffffffff8160b4d4>] rt_spin_lock+0x24/0x70
[    0.221304]  [<ffffffff8107fddd>] ? migrate_disable+0x7d/0xe0
[    0.221305]  [<ffffffff8106ee09>] rescuer_thread+0xa9/0x340
[    0.221307]  [<ffffffff8106ed60>] ? worker_thread+0x4d0/0x4d0
[    0.221308]  [<ffffffff8106ed60>] ? worker_thread+0x4d0/0x4d0
[    0.221311]  [<ffffffff81073721>] kthread+0xe1/0x100
[    0.221312]  [<ffffffff8160b1e0>] ? _raw_spin_unlock_irq+0x30/0x70 
[    0.221315]  [<ffffffff81073640>] ? __kthread_parkme+0xa0/0xa0
[    0.221317]  [<ffffffff8160be88>] ret_from_fork+0x58/0x90
[    0.221319]  [<ffffffff81073640>] ? __kthread_parkme+0xa0/0xa0
[    0.221320] ---[ end trace 0000000000000001 ]---

Signed-off-by: Mike Galbraith <umgwanakikbuti@xxxxxxxxx>
---
 kernel/workqueue.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2255,8 +2255,6 @@ static int rescuer_thread(void *__rescue
 	 */
 	rescuer->task->flags |= PF_WQ_WORKER;
 repeat:
-	set_current_state(TASK_INTERRUPTIBLE);
-
 	/*
 	 * By the time the rescuer is requested to stop, the workqueue
 	 * shouldn't have any work pending, but @wq->maydays may still have
@@ -2270,6 +2268,8 @@ static int rescuer_thread(void *__rescue
 	/* see whether any pwq is asking for help */
 	spin_lock_irq(&wq_mayday_lock);
 
+	set_current_state(TASK_INTERRUPTIBLE);
+
 	while (!list_empty(&wq->maydays)) {
 		struct pool_workqueue *pwq = list_first_entry(&wq->maydays,
 					struct pool_workqueue, mayday_node);
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux