From: Oleg Nesterov Date: Wed, 23 May 2007 20:57:57 +0000 (-0700) Subject: simplify cleanup_workqueue_thread() X-Git-Tag: v2.6.22-rc3~47 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14441960e8c27a64487e0b455b323e784f33583f;p=pandora-kernel.git simplify cleanup_workqueue_thread() cleanup_workqueue_thread() and cwq_should_stop() are overcomplicated. Convert the code to use kthread_should_stop/kthread_stop as was suggested by Gautham and Srivatsa. In particular this patch removes the (unlikely) busy-wait loop from the exit path, it was a temporary and ugly kludge (if not a bug). Note: the current code was designed to solve another old problem: work->func can't share locks with hotplug callbacks. I think this could be done, see http://marc.info/?l=linux-kernel&m=116905366428633 but this needs some more complications to preserve CPU affinity of cwq->thread during cpu_up(). A freezer-based hotplug looks more appealing. [akpm@linux-foundation.org: make it more tolerant of gcc borkenness] Signed-off-by: Oleg Nesterov Cc: Zilvinas Valinskas Cc: Gautham R Shenoy Cc: Srivatsa Vaddagiri Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed