[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1406347444-4045-1-git-send-email-laijs@cn.fujitsu.com>
Date: Sat, 26 Jul 2014 12:03:59 +0800
From: Lai Jiangshan <laijs@...fujitsu.com>
To: <linux-kernel@...r.kernel.org>
CC: Tejun Heo <tj@...nel.org>, Lai Jiangshan <laijs@...fujitsu.com>,
Andrew Morton <akpm@...ux-foundation.org>,
David Rientjes <rientjes@...gle.com>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Nishanth Aravamudan <nacc@...ux.vnet.ibm.com>
Subject: [PATCH] kthread_work: wake up worker only when the worker is idle
If the worker task is not idle, it may sleep on some conditions by the request
of the work. Our unfriendly wakeup in the insert_kthread_work() may confuse
the worker.
Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
---
kernel/kthread.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/kthread.c b/kernel/kthread.c
index c2390f4..ef48322 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -591,7 +591,7 @@ static void insert_kthread_work(struct kthread_worker *worker,
list_add_tail(&work->node, pos);
work->worker = worker;
- if (likely(worker->task))
+ if (!worker->current_work && likely(worker->task))
wake_up_process(worker->task);
}
--
1.7.4.4
--
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