Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

workqueue: Rename pool->watchdog_ts to pool->last_progress_ts

The watchdog_ts name doesn't convey what the timestamp actually tracks.
This field tracks the last time a workqueue got progress.

Rename it to last_progress_ts to make it clear that it records when the
pool last made forward progress (started processing new work items).

No functional change.

Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Breno Leitao and committed by
Tejun Heo
6037160e f42f9091

+7 -7
+7 -7
kernel/workqueue.c
··· 190 190 int id; /* I: pool ID */ 191 191 unsigned int flags; /* L: flags */ 192 192 193 - unsigned long watchdog_ts; /* L: watchdog timestamp */ 193 + unsigned long last_progress_ts; /* L: last forward progress timestamp */ 194 194 bool cpu_stall; /* WD: stalled cpu bound pool */ 195 195 196 196 /* ··· 1697 1697 WARN_ON_ONCE(!(*wdb & WORK_STRUCT_INACTIVE)); 1698 1698 trace_workqueue_activate_work(work); 1699 1699 if (list_empty(&pwq->pool->worklist)) 1700 - pwq->pool->watchdog_ts = jiffies; 1700 + pwq->pool->last_progress_ts = jiffies; 1701 1701 move_linked_works(work, &pwq->pool->worklist, NULL); 1702 1702 __clear_bit(WORK_STRUCT_INACTIVE_BIT, wdb); 1703 1703 } ··· 2348 2348 */ 2349 2349 if (list_empty(&pwq->inactive_works) && pwq_tryinc_nr_active(pwq, false)) { 2350 2350 if (list_empty(&pool->worklist)) 2351 - pool->watchdog_ts = jiffies; 2351 + pool->last_progress_ts = jiffies; 2352 2352 2353 2353 trace_workqueue_activate_work(work); 2354 2354 insert_work(pwq, work, &pool->worklist, work_flags); ··· 3352 3352 while ((work = list_first_entry_or_null(&worker->scheduled, 3353 3353 struct work_struct, entry))) { 3354 3354 if (first) { 3355 - worker->pool->watchdog_ts = jiffies; 3355 + worker->pool->last_progress_ts = jiffies; 3356 3356 first = false; 3357 3357 } 3358 3358 process_one_work(worker, work); ··· 4850 4850 pool->cpu = -1; 4851 4851 pool->node = NUMA_NO_NODE; 4852 4852 pool->flags |= POOL_DISASSOCIATED; 4853 - pool->watchdog_ts = jiffies; 4853 + pool->last_progress_ts = jiffies; 4854 4854 INIT_LIST_HEAD(&pool->worklist); 4855 4855 INIT_LIST_HEAD(&pool->idle_list); 4856 4856 hash_init(pool->busy_hash); ··· 6462 6462 6463 6463 /* How long the first pending work is waiting for a worker. */ 6464 6464 if (!list_empty(&pool->worklist)) 6465 - hung = jiffies_to_msecs(jiffies - pool->watchdog_ts) / 1000; 6465 + hung = jiffies_to_msecs(jiffies - pool->last_progress_ts) / 1000; 6466 6466 6467 6467 /* 6468 6468 * Defer printing to avoid deadlocks in console drivers that ··· 7691 7691 touched = READ_ONCE(per_cpu(wq_watchdog_touched_cpu, pool->cpu)); 7692 7692 else 7693 7693 touched = READ_ONCE(wq_watchdog_touched); 7694 - pool_ts = READ_ONCE(pool->watchdog_ts); 7694 + pool_ts = READ_ONCE(pool->last_progress_ts); 7695 7695 7696 7696 if (time_after(pool_ts, touched)) 7697 7697 ts = pool_ts;