Skip to content

Commit 6037160

Browse files
leitaohtejun
authored andcommitted
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>
1 parent f42f909 commit 6037160

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

kernel/workqueue.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ struct worker_pool {
190190
int id; /* I: pool ID */
191191
unsigned int flags; /* L: flags */
192192

193-
unsigned long watchdog_ts; /* L: watchdog timestamp */
193+
unsigned long last_progress_ts; /* L: last forward progress timestamp */
194194
bool cpu_stall; /* WD: stalled cpu bound pool */
195195

196196
/*
@@ -1697,7 +1697,7 @@ static void __pwq_activate_work(struct pool_workqueue *pwq,
16971697
WARN_ON_ONCE(!(*wdb & WORK_STRUCT_INACTIVE));
16981698
trace_workqueue_activate_work(work);
16991699
if (list_empty(&pwq->pool->worklist))
1700-
pwq->pool->watchdog_ts = jiffies;
1700+
pwq->pool->last_progress_ts = jiffies;
17011701
move_linked_works(work, &pwq->pool->worklist, NULL);
17021702
__clear_bit(WORK_STRUCT_INACTIVE_BIT, wdb);
17031703
}
@@ -2348,7 +2348,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
23482348
*/
23492349
if (list_empty(&pwq->inactive_works) && pwq_tryinc_nr_active(pwq, false)) {
23502350
if (list_empty(&pool->worklist))
2351-
pool->watchdog_ts = jiffies;
2351+
pool->last_progress_ts = jiffies;
23522352

23532353
trace_workqueue_activate_work(work);
23542354
insert_work(pwq, work, &pool->worklist, work_flags);
@@ -3352,7 +3352,7 @@ static void process_scheduled_works(struct worker *worker)
33523352
while ((work = list_first_entry_or_null(&worker->scheduled,
33533353
struct work_struct, entry))) {
33543354
if (first) {
3355-
worker->pool->watchdog_ts = jiffies;
3355+
worker->pool->last_progress_ts = jiffies;
33563356
first = false;
33573357
}
33583358
process_one_work(worker, work);
@@ -4850,7 +4850,7 @@ static int init_worker_pool(struct worker_pool *pool)
48504850
pool->cpu = -1;
48514851
pool->node = NUMA_NO_NODE;
48524852
pool->flags |= POOL_DISASSOCIATED;
4853-
pool->watchdog_ts = jiffies;
4853+
pool->last_progress_ts = jiffies;
48544854
INIT_LIST_HEAD(&pool->worklist);
48554855
INIT_LIST_HEAD(&pool->idle_list);
48564856
hash_init(pool->busy_hash);
@@ -6462,7 +6462,7 @@ static void show_one_worker_pool(struct worker_pool *pool)
64626462

64636463
/* How long the first pending work is waiting for a worker. */
64646464
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;
64666466

64676467
/*
64686468
* Defer printing to avoid deadlocks in console drivers that
@@ -7691,7 +7691,7 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)
76917691
touched = READ_ONCE(per_cpu(wq_watchdog_touched_cpu, pool->cpu));
76927692
else
76937693
touched = READ_ONCE(wq_watchdog_touched);
7694-
pool_ts = READ_ONCE(pool->watchdog_ts);
7694+
pool_ts = READ_ONCE(pool->last_progress_ts);
76957695

76967696
if (time_after(pool_ts, touched))
76977697
ts = pool_ts;

0 commit comments

Comments
 (0)