[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C2DA4E2.8030502@gmail.com>
Date: Fri, 02 Jul 2010 10:35:46 +0200
From: Tejun Heo <htejun@...il.com>
To: torvalds@...ux-foundation.org, mingo@...e.hu,
linux-kernel@...r.kernel.org, jeff@...zik.org,
akpm@...ux-foundation.org, rusty@...tcorp.com.au,
cl@...ux-foundation.org, dhowells@...hat.com,
arjan@...ux.intel.com, oleg@...hat.com, axboe@...nel.dk,
fweisbec@...il.com, dwalker@...eaurora.org,
stefanr@...6.in-berlin.de, florian@...kler.org,
andi@...stfloor.org, mst@...hat.com, randy.dunlap@...cle.com
Subject: [PATCH 4/4] workqueue: fix worker management invocation without pending
works
When there's no pending work to do, worker_thread() goes back to sleep
after waking up without checking whether worker management is
necessary. This means that idle worker exit requests can be ignored
if the gcwq stays empty.
Fix it by making worker_thread() always check whether worker
management is necessary before going to sleep.
Signed-off-by: Tejun Heo <tj@...nel.org>
---
kernel/workqueue.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 0c485a5..2eb9fbd 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1832,10 +1832,10 @@ recheck:
} while (keep_working(gcwq));
worker_set_flags(worker, WORKER_PREP, false);
-
+sleep:
if (unlikely(need_to_manage_workers(gcwq)) && manage_workers(worker))
goto recheck;
-sleep:
+
/*
* gcwq->lock is held and there's no work to process and no
* need to manage, sleep. Workers are woken up only while
--
1.6.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists