diff options
author | Tejun Heo <tj@kernel.org> | 2023-08-08 03:57:22 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2023-08-08 03:57:22 +0200 |
commit | bc8b50c2dfac946c1beed782c1823e52cf55a352 (patch) | |
tree | fed2c448bbef1ece384d2ec2e0528aa5368b92cb /kernel/workqueue_internal.h | |
parent | workqueue: Merge branch 'for-6.5-fixes' into for-6.6 (diff) | |
download | linux-bc8b50c2dfac946c1beed782c1823e52cf55a352.tar.xz linux-bc8b50c2dfac946c1beed782c1823e52cf55a352.zip |
workqueue: Drop the special locking rule for worker->flags and worker_pool->flags
worker->flags used to be accessed from scheduler hooks without grabbing
pool->lock for concurrency management. This is no longer true since
6d25be5782e4 ("sched/core, workqueues: Distangle worker accounting from rq
lock"). Also, it's unclear why worker_pool->flags was using the "X" rule.
All relevant users are accessing it under the pool lock.
Let's drop the special "X" rule and use the "L" rule for these flag fields
instead. While at it, replace the CONTEXT comment with
lockdep_assert_held().
This allows worker_set/clr_flags() to be used from context which isn't the
worker itself. This will be used later to implement assinging work items to
workers before waking them up so that workqueue can have better control over
which worker executes which work item on which CPU.
The only actual changes are sanity checks. There shouldn't be any visible
behavior changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue_internal.h')
-rw-r--r-- | kernel/workqueue_internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h index 6b1d66e28269..f6275944ada7 100644 --- a/kernel/workqueue_internal.h +++ b/kernel/workqueue_internal.h @@ -48,7 +48,7 @@ struct worker { /* A: runs through worker->node */ unsigned long last_active; /* K: last active timestamp */ - unsigned int flags; /* X: flags */ + unsigned int flags; /* L: flags */ int id; /* I: worker id */ /* |