summaryrefslogtreecommitdiff
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index f8b5598f7272..4ec3db31493d 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1468,7 +1468,7 @@ void wq_worker_running(struct task_struct *task)
* CPU intensive auto-detection cares about how long a work item hogged
* CPU without sleeping. Reset the starting timestamp on wakeup.
*/
- worker->current_at = worker->task->se.sum_exec_runtime;
+ worker->current_at = READ_ONCE(worker->task->se.sum_exec_runtime);
WRITE_ONCE(worker->sleeping, 0);
}
@@ -1557,7 +1557,7 @@ void wq_worker_tick(struct task_struct *task)
* We probably want to make this prettier in the future.
*/
if ((worker->flags & WORKER_NOT_RUNNING) || READ_ONCE(worker->sleeping) ||
- worker->task->se.sum_exec_runtime - worker->current_at <
+ READ_ONCE(worker->task->se.sum_exec_runtime) - worker->current_at <
wq_cpu_intensive_thresh_us * NSEC_PER_USEC)
return;
@@ -3294,7 +3294,7 @@ __acquires(&pool->lock)
worker->current_func = work->func;
worker->current_pwq = pwq;
if (worker->task)
- worker->current_at = worker->task->se.sum_exec_runtime;
+ worker->current_at = READ_ONCE(worker->task->se.sum_exec_runtime);
worker->current_start = jiffies;
work_data = *work_data_bits(work);
worker->current_color = get_work_color(work_data);