History

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.

Breno Leitao committed 8 months ago

Commit 60371601 parent f42f9091 file · +7 −7Browse files

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+7−7
@@ -190,7 +190,7 @@ struct worker_pool { · 189 unmodified lines
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, · 1500 unmodified lines
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 @@ retry: · 644 unmodified lines
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) · 997 unmodified lines
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) · 1491 unmodified lines
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) · 1605 unmodified lines
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) · 1222 unmodified lines
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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t