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