[PATCH] workqueue: use common cwq_set_max_active() forworkqueue_set_max_active()

From: Lai Jiangshan
Date: Tue Sep 18 2012 - 04:26:30 EST


workqueue_set_max_active() may increase ->max_active without activating
delayed works. And it may cause the activation order doesn't equal to
to queue_work()-order.

To make things consist, we use common cwq_set_max_active() logic which
immediately makes use of the newly increased max_mactive if there are
delayed work items and also keep activation ordering.

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---
kernel/workqueue.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index d0ca063..8783414 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3458,7 +3458,7 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active)

if (!(wq->flags & WQ_FREEZABLE) ||
!(gcwq->flags & GCWQ_FREEZING))
- get_cwq(gcwq->cpu, wq)->max_active = max_active;
+ cwq_set_max_active(get_cwq(gcwq->cpu, wq), max_active);

spin_unlock_irq(&gcwq->lock);
}
--
1.7.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/