Re: [RFC v3 4/7] workqueue: use new hashtable implementation
From: Joe Perches <joe@perches.com>
Date: 2012-08-07 01:19:21
Also in:
linux-mm, lkml
On Tue, 2012-08-07 at 02:45 +0200, Sasha Levin wrote:
From: Sasha Levin <redacted> Switch workqueues to use the new hashtable implementation. This reduces the amount of generic unrelated code in the workqueues.
Just style trivia:
quoted hunk ↗ jump to hunk
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
[]
quoted hunk ↗ jump to hunk
@@ -897,8 +839,15 @@ static struct worker *__find_worker_executing_work(struct global_cwq *gcwq, static struct worker *find_worker_executing_work(struct global_cwq *gcwq, struct work_struct *work) { - return __find_worker_executing_work(gcwq, busy_worker_head(gcwq, work), - work); + struct worker *worker; + struct hlist_node *tmp; + + hash_for_each_possible(gcwq->busy_hash, worker, BUSY_WORKER_HASH_ORDER, + tmp, hentry, work) + if (worker->current_work == work) + return worker;
braces please:
hash_for_each_possible(gcwq->busy_hash, worker, BUSY_WORKER_HASH_ORDER,
tmp, hentry, work) {
if (worker->current_work == work)
return worker;
}
[]
@@ -1916,7 +1865,7 @@ static void cwq_dec_nr_in_flight(struct cpu_workqueue_struct *cwq, int color,* @worker: self * @work: work to process * - * Process @work. This function contains all the logics necessary to + * Process @work. This? function contains all the logics necessary to
Odd ? and the grammar also seems odd.
* process a single work including synchronization against and * interaction with other workers on the same cpu, queueing and * flushing. As long as context requirement is met, any worker can
-- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>