Re: [PATCH] sched: don't clear PF_THREAD_BOUND in select_fallback_rq

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

 



* Sebastian Andrzej Siewior | 2013-06-07 22:50:48 [+0200]:

>* Qiang Huang | 2013-04-25 17:01:18 [+0800]:
>
>>select_fallback_rq() is called and PF_THREAD_BOUND is cleared. In my
>>box, 1/3 bounded kernel threads will clear that flag after boot.
>
>Please tell me _which_ threads lose this flag. I don't see this…

The only way I lose this flag is by starting a workqueue on a CPU which
if offline. Now that is wrong. I am not sure if the workqueue re-uses
the "idle" workers later. In the up path it sets the CPU mask and
PF_THREAD_BOUND is usually set (unless it was lost due to
select_fallback_rq()). So we can set this back on:

Subject: [PATCH] kernel/workqueue: Add PF_THREAD_BOUND after set_cpu

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
 kernel/workqueue.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 11285e4..aff5841 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1637,8 +1637,10 @@ __acquires(&gcwq->lock)
 		 * it races with cpu hotunplug operation.  Verify
 		 * against GCWQ_DISASSOCIATED.
 		 */
-		if (!(gcwq->flags & GCWQ_DISASSOCIATED))
+		if (!(gcwq->flags & GCWQ_DISASSOCIATED)) {
 			set_cpus_allowed_ptr(task, get_cpu_mask(gcwq->cpu));
+			task->flags |= PF_THREAD_BOUND;
+		}
 
 		spin_lock_irq(&gcwq->lock);
 		if (gcwq->flags & GCWQ_DISASSOCIATED)
-- 
1.7.10.4

Do you see any other?

Sebastian
--
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