Skip to content

Commit 84f91c6

Browse files
Lai Jiangshanhtejun
authored andcommitted
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 <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 989442d commit 84f91c6

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

kernel/workqueue.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ struct worker_pool {
154154

155155
unsigned long watchdog_ts; /* L: watchdog timestamp */
156156

157+
/* The current concurrency level. */
158+
atomic_t nr_running;
159+
157160
struct list_head worklist; /* L: list of pending works */
158161

159162
int nr_workers; /* L: total number of workers */
@@ -177,19 +180,12 @@ struct worker_pool {
177180
struct hlist_node hash_node; /* PL: unbound_pool_hash node */
178181
int refcnt; /* PL: refcnt for unbound pools */
179182

180-
/*
181-
* The current concurrency level. As it's likely to be accessed
182-
* from other CPUs during try_to_wake_up(), put it in a separate
183-
* cacheline.
184-
*/
185-
atomic_t nr_running ____cacheline_aligned_in_smp;
186-
187183
/*
188184
* Destruction of pool is RCU protected to allow dereferences
189185
* from get_work_pool().
190186
*/
191187
struct rcu_head rcu;
192-
} ____cacheline_aligned_in_smp;
188+
};
193189

194190
/*
195191
* The per-pool workqueue. While queued, the lower WORK_STRUCT_FLAG_BITS

0 commit comments

Comments
 (0)