Commit e987af4
committed
Merge tag 'percpu-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu
Pull percpu updates from Dennis Zhou:
"One bigger change to percpu_counter's api allowing for init and
destroy of multiple counters via percpu_counter_init_many() and
percpu_counter_destroy_many(). This is used to help begin remediating
a performance regression with percpu rss stats.
Additionally, it seems larger core count machines are feeling the
burden of the single threaded allocation of percpu. Mateusz is
thinking about it and I will spend some time on it too.
percpu:
- A couple cleanups by Baoquan He and Bibo Mao. The only behavior
change is to start printing messages if we're under the warn limit
for failed atomic allocations.
percpu_counter:
- Shakeel introduced percpu counters into mm_struct which caused
percpu allocations be on the hot path [1]. Originally I spent some
time trying to improve the percpu allocator, but instead preferred
what Mateusz Guzik proposed grouping at the allocation site,
percpu_counter_init_many(). This allows a single percpu allocation
to be shared by the counters. I like this approach because it
creates a shared lifetime by the allocations. Additionally, I
believe many inits have higher level synchronization requirements,
like percpu_counter does against HOTPLUG_CPU. Therefore we can
group these optimizations together"
Link: https://lore.kernel.org/linux-mm/20221024052841.3291983-1-shakeelb@google.com/ [1]
* tag 'percpu-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu:
kernel/fork: group allocation/free of per-cpu counters for mm struct
pcpcntr: add group allocation/free
mm/percpu.c: print error message too if atomic alloc failed
mm/percpu.c: optimize the code in pcpu_setup_first_chunk() a little bit
mm/percpu.c: remove redundant check
mm/percpu: Remove some local variables in pcpu_populate_pte4 files changed
Lines changed: 109 additions & 78 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
| |||
116 | 127 | | |
117 | 128 | | |
118 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
119 | 142 | | |
120 | 143 | | |
121 | 144 | | |
122 | | - | |
123 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
124 | 151 | | |
125 | 152 | | |
126 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
912 | | - | |
913 | | - | |
914 | 912 | | |
915 | 913 | | |
916 | 914 | | |
| |||
925 | 923 | | |
926 | 924 | | |
927 | 925 | | |
| 926 | + | |
928 | 927 | | |
929 | | - | |
930 | | - | |
931 | 928 | | |
932 | 929 | | |
933 | 930 | | |
| |||
1260 | 1257 | | |
1261 | 1258 | | |
1262 | 1259 | | |
1263 | | - | |
1264 | | - | |
1265 | 1260 | | |
1266 | 1261 | | |
1267 | 1262 | | |
| |||
1309 | 1304 | | |
1310 | 1305 | | |
1311 | 1306 | | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
1315 | 1310 | | |
1316 | 1311 | | |
1317 | 1312 | | |
1318 | 1313 | | |
1319 | 1314 | | |
1320 | 1315 | | |
1321 | | - | |
1322 | | - | |
1323 | 1316 | | |
1324 | 1317 | | |
1325 | 1318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
164 | 168 | | |
| 169 | + | |
165 | 170 | | |
166 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
167 | 182 | | |
168 | 183 | | |
169 | | - | |
170 | 184 | | |
171 | | - | |
| 185 | + | |
| 186 | + | |
172 | 187 | | |
173 | 188 | | |
174 | 189 | | |
175 | 190 | | |
176 | | - | |
| 191 | + | |
177 | 192 | | |
178 | | - | |
| 193 | + | |
179 | 194 | | |
180 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
181 | 200 | | |
182 | | - | |
| 201 | + | |
183 | 202 | | |
184 | 203 | | |
185 | | - | |
| 204 | + | |
| 205 | + | |
186 | 206 | | |
187 | 207 | | |
188 | 208 | | |
189 | | - | |
| 209 | + | |
| 210 | + | |
190 | 211 | | |
191 | 212 | | |
192 | | - | |
193 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
194 | 218 | | |
195 | | - | |
| 219 | + | |
196 | 220 | | |
197 | 221 | | |
198 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1890 | 1890 | | |
1891 | 1891 | | |
1892 | 1892 | | |
1893 | | - | |
| 1893 | + | |
1894 | 1894 | | |
1895 | 1895 | | |
1896 | | - | |
| 1896 | + | |
| 1897 | + | |
1897 | 1898 | | |
1898 | 1899 | | |
1899 | 1900 | | |
| 1901 | + | |
1900 | 1902 | | |
1901 | 1903 | | |
1902 | 1904 | | |
| |||
2581 | 2583 | | |
2582 | 2584 | | |
2583 | 2585 | | |
2584 | | - | |
2585 | 2586 | | |
2586 | 2587 | | |
2587 | 2588 | | |
2588 | 2589 | | |
2589 | 2590 | | |
2590 | 2591 | | |
2591 | | - | |
2592 | 2592 | | |
2593 | 2593 | | |
2594 | 2594 | | |
| |||
2615 | 2615 | | |
2616 | 2616 | | |
2617 | 2617 | | |
2618 | | - | |
2619 | 2618 | | |
2620 | 2619 | | |
2621 | 2620 | | |
| |||
2698 | 2697 | | |
2699 | 2698 | | |
2700 | 2699 | | |
2701 | | - | |
| 2700 | + | |
2702 | 2701 | | |
2703 | 2702 | | |
2704 | 2703 | | |
| |||
2735 | 2734 | | |
2736 | 2735 | | |
2737 | 2736 | | |
2738 | | - | |
2739 | | - | |
2740 | | - | |
2741 | | - | |
2742 | | - | |
2743 | | - | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
2744 | 2746 | | |
2745 | 2747 | | |
2746 | | - | |
2747 | | - | |
2748 | | - | |
2749 | | - | |
2750 | | - | |
2751 | | - | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
2752 | 2753 | | |
2753 | | - | |
2754 | | - | |
2755 | | - | |
2756 | | - | |
2757 | | - | |
2758 | | - | |
2759 | | - | |
2760 | | - | |
2761 | 2754 | | |
2762 | 2755 | | |
2763 | 2756 | | |
| |||
3189 | 3182 | | |
3190 | 3183 | | |
3191 | 3184 | | |
3192 | | - | |
3193 | | - | |
3194 | | - | |
3195 | | - | |
| 3185 | + | |
| 3186 | + | |
3196 | 3187 | | |
3197 | | - | |
| 3188 | + | |
3198 | 3189 | | |
3199 | 3190 | | |
3200 | 3191 | | |
3201 | 3192 | | |
3202 | | - | |
3203 | | - | |
3204 | | - | |
3205 | | - | |
| 3193 | + | |
| 3194 | + | |
3206 | 3195 | | |
3207 | | - | |
| 3196 | + | |
3208 | 3197 | | |
3209 | 3198 | | |
3210 | 3199 | | |
3211 | 3200 | | |
3212 | | - | |
3213 | | - | |
3214 | | - | |
3215 | | - | |
| 3201 | + | |
| 3202 | + | |
3216 | 3203 | | |
3217 | | - | |
| 3204 | + | |
3218 | 3205 | | |
3219 | 3206 | | |
3220 | 3207 | | |
| |||
0 commit comments