From: Tejun Heo Date: Tue, 12 Mar 2013 18:30:04 +0000 (-0700) Subject: workqueue: prepare flush_workqueue() for dynamic creation and destrucion of unbound... X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~125^2~57 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75ccf5950f828d53aebfd3a852283a00abf2c5bf;p=pandora-kernel.git workqueue: prepare flush_workqueue() for dynamic creation and destrucion of unbound pool_workqueues Unbound pwqs (pool_workqueues) will be dynamically created and destroyed with the scheduled unbound workqueue w/ custom attributes support. This patch synchronizes pwq linking and unlinking against flush_workqueue() so that its operation isn't disturbed by pwqs coming and going. Linking and unlinking a pwq into wq->pwqs is now protected also by wq->flush_mutex and a new pwq's work_color is initialized to wq->work_color during linking. This ensures that pwqs changes don't disturb flush_workqueue() in progress and the new pwq's work coloring stays in sync with the rest of the workqueue. flush_mutex during unlinking isn't strictly necessary but it's simpler to do it anyway. Signed-off-by: Tejun Heo Reviewed-by: Lai Jiangshan --- Reading git-diff-tree failed