summaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@linux.alibaba.com>2021-12-07 08:35:42 +0100
committerTejun Heo <tj@kernel.org>2021-12-09 23:26:54 +0100
commit84f91c62d675480ffd3d870ee44c07965cbd8b21 (patch)
tree585a176feee7061b5921ba5ee06f9e9a1de6542a /kernel/workqueue.c
parentworkqueue: Move the code of waking a worker up in unbind_workers() (diff)
downloadlinux-84f91c62d675480ffd3d870ee44c07965cbd8b21.tar.xz
linux-84f91c62d675480ffd3d870ee44c07965cbd8b21.zip
workqueue: Remove the cacheline_aligned for nr_running
nr_running is never modified remotely after the schedule callback in wakeup path is removed. Rather nr_running is often accessed with other fields in the pool together, so the cacheline_aligned for nr_running isn't needed. Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 403387e9a924..b583141c5481 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -154,6 +154,9 @@ struct worker_pool {
unsigned long watchdog_ts; /* L: watchdog timestamp */
+ /* The current concurrency level. */
+ atomic_t nr_running;
+
struct list_head worklist; /* L: list of pending works */
int nr_workers; /* L: total number of workers */
@@ -178,18 +181,11 @@ struct worker_pool {
int refcnt; /* PL: refcnt for unbound pools */
/*
- * The current concurrency level. As it's likely to be accessed
- * from other CPUs during try_to_wake_up(), put it in a separate
- * cacheline.
- */
- atomic_t nr_running ____cacheline_aligned_in_smp;
-
- /*
* Destruction of pool is RCU protected to allow dereferences
* from get_work_pool().
*/
struct rcu_head rcu;
-} ____cacheline_aligned_in_smp;
+};
/*
* The per-pool workqueue. While queued, the lower WORK_STRUCT_FLAG_BITS