History

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.

Lai Jiangshan committed 4 years ago

Commit 84f91c61 parent 989442d1 file · +4 −8Browse files

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

Unified · Split

kernel/workqueue.c+4−8
@@ -154,6 +154,9 @@ struct worker_pool { · 153 unmodified lines
154 154
155 unsigned long watchdog_ts; /* L: watchdog timestamp */155 unsigned long watchdog_ts; /* L: watchdog timestamp */
156 156
157 /* The current concurrency level. */
158 atomic_t nr_running;
159
157 struct list_head worklist; /* L: list of pending works */160 struct list_head worklist; /* L: list of pending works */
158 161
159 int nr_workers; /* L: total number of workers */162 int nr_workers; /* L: total number of workers */
@@ -177,19 +180,12 @@ struct worker_pool { · 17 unmodified lines
177 struct hlist_node hash_node; /* PL: unbound_pool_hash node */180 struct hlist_node hash_node; /* PL: unbound_pool_hash node */
178 int refcnt; /* PL: refcnt for unbound pools */181 int refcnt; /* PL: refcnt for unbound pools */
179 182
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
187 /*183 /*
188 * Destruction of pool is RCU protected to allow dereferences184 * Destruction of pool is RCU protected to allow dereferences
189 * from get_work_pool().185 * from get_work_pool().
190 */186 */
191 struct rcu_head rcu;187 struct rcu_head rcu;
192} ____cacheline_aligned_in_smp;188};
193 189
194/*190/*
195 * The per-pool workqueue. While queued, the lower WORK_STRUCT_FLAG_BITS191 * The per-pool workqueue. While queued, the lower WORK_STRUCT_FLAG_BITS

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