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
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 { · 17 unmodified lines
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

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