workqueue: remove @delayed from cwq_dec_nr_in_flight()
@delayed is now always false for all callers, remove it. tj: Updated description. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
3aa6249759
commit
b3f9f405a2
@ -999,7 +999,6 @@ static void cwq_activate_first_delayed(struct cpu_workqueue_struct *cwq)
|
|||||||
* cwq_dec_nr_in_flight - decrement cwq's nr_in_flight
|
* cwq_dec_nr_in_flight - decrement cwq's nr_in_flight
|
||||||
* @cwq: cwq of interest
|
* @cwq: cwq of interest
|
||||||
* @color: color of work which left the queue
|
* @color: color of work which left the queue
|
||||||
* @delayed: for a delayed work
|
|
||||||
*
|
*
|
||||||
* A work either has completed or is removed from pending queue,
|
* A work either has completed or is removed from pending queue,
|
||||||
* decrement nr_in_flight of its cwq and handle workqueue flushing.
|
* decrement nr_in_flight of its cwq and handle workqueue flushing.
|
||||||
@ -1007,8 +1006,7 @@ static void cwq_activate_first_delayed(struct cpu_workqueue_struct *cwq)
|
|||||||
* CONTEXT:
|
* CONTEXT:
|
||||||
* spin_lock_irq(gcwq->lock).
|
* spin_lock_irq(gcwq->lock).
|
||||||
*/
|
*/
|
||||||
static void cwq_dec_nr_in_flight(struct cpu_workqueue_struct *cwq, int color,
|
static void cwq_dec_nr_in_flight(struct cpu_workqueue_struct *cwq, int color)
|
||||||
bool delayed)
|
|
||||||
{
|
{
|
||||||
/* ignore uncolored works */
|
/* ignore uncolored works */
|
||||||
if (color == WORK_NO_COLOR)
|
if (color == WORK_NO_COLOR)
|
||||||
@ -1016,13 +1014,11 @@ static void cwq_dec_nr_in_flight(struct cpu_workqueue_struct *cwq, int color,
|
|||||||
|
|
||||||
cwq->nr_in_flight[color]--;
|
cwq->nr_in_flight[color]--;
|
||||||
|
|
||||||
if (!delayed) {
|
cwq->nr_active--;
|
||||||
cwq->nr_active--;
|
if (!list_empty(&cwq->delayed_works)) {
|
||||||
if (!list_empty(&cwq->delayed_works)) {
|
/* one down, submit a delayed one */
|
||||||
/* one down, submit a delayed one */
|
if (cwq->nr_active < cwq->max_active)
|
||||||
if (cwq->nr_active < cwq->max_active)
|
cwq_activate_first_delayed(cwq);
|
||||||
cwq_activate_first_delayed(cwq);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* is flush in progress and are we at the flushing tip? */
|
/* is flush in progress and are we at the flushing tip? */
|
||||||
@ -1127,8 +1123,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork,
|
|||||||
|
|
||||||
list_del_init(&work->entry);
|
list_del_init(&work->entry);
|
||||||
cwq_dec_nr_in_flight(get_work_cwq(work),
|
cwq_dec_nr_in_flight(get_work_cwq(work),
|
||||||
get_work_color(work),
|
get_work_color(work));
|
||||||
*work_data_bits(work) & WORK_STRUCT_DELAYED);
|
|
||||||
|
|
||||||
spin_unlock(&gcwq->lock);
|
spin_unlock(&gcwq->lock);
|
||||||
return 1;
|
return 1;
|
||||||
@ -2264,7 +2259,7 @@ __acquires(&gcwq->lock)
|
|||||||
hlist_del_init(&worker->hentry);
|
hlist_del_init(&worker->hentry);
|
||||||
worker->current_work = NULL;
|
worker->current_work = NULL;
|
||||||
worker->current_cwq = NULL;
|
worker->current_cwq = NULL;
|
||||||
cwq_dec_nr_in_flight(cwq, work_color, false);
|
cwq_dec_nr_in_flight(cwq, work_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user