]> git.baikalelectronics.ru Git - kernel.git/commit
workqueue: reimplement workqueue freeze using max_active
authorTejun Heo <tj@kernel.org>
Tue, 29 Jun 2010 08:07:12 +0000 (10:07 +0200)
committerTejun Heo <tj@kernel.org>
Tue, 29 Jun 2010 08:07:12 +0000 (10:07 +0200)
commitfc40c458bbea5af84b9631c6188cee7b25f75472
tree6df8eddcaeff6cde892c8cae6bdfa7653805e144
parent71e83dc598518348c777745fcc90d0eccddc09b6
workqueue: reimplement workqueue freeze using max_active

Currently, workqueue freezing is implemented by marking the worker
freezeable and calling try_to_freeze() from dispatch loop.
Reimplement it using cwq->limit so that the workqueue is frozen
instead of the worker.

* workqueue_struct->saved_max_active is added which stores the
  specified max_active on initialization.

* On freeze, all cwq->max_active's are quenched to zero.  Freezing is
  complete when nr_active on all cwqs reach zero.

* On thaw, all cwq->max_active's are restored to wq->saved_max_active
  and the worklist is repopulated.

This new implementation allows having single shared pool of workers
per cpu.

Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/workqueue.h
kernel/power/process.c
kernel/workqueue.c