Commit dbbee9d
mm/page_alloc: convert per-cpu list protection to local_lock
There is a lack of clarity of what exactly
local_irq_save/local_irq_restore protects in page_alloc.c . It conflates
the protection of per-cpu page allocation structures with per-cpu vmstat
deltas.
This patch protects the PCP structure using local_lock which for most
configurations is identical to IRQ enabling/disabling. The scope of the
lock is still wider than it should be but this is decreased later.
It is possible for the local_lock to be embedded safely within struct
per_cpu_pages but it adds complexity to free_unref_page_list.
[akpm@linux-foundation.org: coding style fixes]
[mgorman@techsingularity.net: work around a pahole limitation with zero-sized struct pagesets]
Link: https://lkml.kernel.org/r/20210526080741.GW30378@techsingularity.net
[lkp@intel.com: Make pagesets static]
Link: https://lkml.kernel.org/r/20210512095458.30632-3-mgorman@techsingularity.net
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 28f836b commit dbbee9d
3 files changed
+51
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| 341 | + | |
340 | 342 | | |
341 | 343 | | |
342 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
316 | 319 | | |
317 | 320 | | |
318 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
125 | 143 | | |
126 | 144 | | |
127 | 145 | | |
| |||
1453 | 1471 | | |
1454 | 1472 | | |
1455 | 1473 | | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
1456 | 1478 | | |
1457 | 1479 | | |
1458 | 1480 | | |
| |||
1573 | 1595 | | |
1574 | 1596 | | |
1575 | 1597 | | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
1576 | 1603 | | |
1577 | 1604 | | |
1578 | 1605 | | |
| |||
2955 | 2982 | | |
2956 | 2983 | | |
2957 | 2984 | | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
2958 | 2989 | | |
2959 | 2990 | | |
2960 | 2991 | | |
| |||
3007 | 3038 | | |
3008 | 3039 | | |
3009 | 3040 | | |
3010 | | - | |
| 3041 | + | |
3011 | 3042 | | |
3012 | 3043 | | |
3013 | 3044 | | |
3014 | 3045 | | |
3015 | | - | |
| 3046 | + | |
3016 | 3047 | | |
3017 | 3048 | | |
3018 | 3049 | | |
| |||
3028 | 3059 | | |
3029 | 3060 | | |
3030 | 3061 | | |
3031 | | - | |
| 3062 | + | |
3032 | 3063 | | |
3033 | 3064 | | |
3034 | 3065 | | |
3035 | 3066 | | |
3036 | 3067 | | |
3037 | | - | |
| 3068 | + | |
3038 | 3069 | | |
3039 | 3070 | | |
3040 | 3071 | | |
| |||
3297 | 3328 | | |
3298 | 3329 | | |
3299 | 3330 | | |
3300 | | - | |
| 3331 | + | |
3301 | 3332 | | |
3302 | | - | |
| 3333 | + | |
3303 | 3334 | | |
3304 | 3335 | | |
3305 | 3336 | | |
| |||
3319 | 3350 | | |
3320 | 3351 | | |
3321 | 3352 | | |
3322 | | - | |
| 3353 | + | |
3323 | 3354 | | |
3324 | 3355 | | |
3325 | 3356 | | |
| |||
3332 | 3363 | | |
3333 | 3364 | | |
3334 | 3365 | | |
3335 | | - | |
| 3366 | + | |
3336 | 3367 | | |
3337 | | - | |
| 3368 | + | |
3338 | 3369 | | |
3339 | 3370 | | |
3340 | | - | |
| 3371 | + | |
3341 | 3372 | | |
3342 | 3373 | | |
3343 | 3374 | | |
| |||
3494 | 3525 | | |
3495 | 3526 | | |
3496 | 3527 | | |
3497 | | - | |
| 3528 | + | |
3498 | 3529 | | |
3499 | 3530 | | |
3500 | 3531 | | |
3501 | 3532 | | |
3502 | 3533 | | |
3503 | 3534 | | |
3504 | 3535 | | |
3505 | | - | |
| 3536 | + | |
3506 | 3537 | | |
3507 | 3538 | | |
3508 | 3539 | | |
| |||
5103 | 5134 | | |
5104 | 5135 | | |
5105 | 5136 | | |
5106 | | - | |
| 5137 | + | |
5107 | 5138 | | |
5108 | 5139 | | |
5109 | 5140 | | |
| |||
5141 | 5172 | | |
5142 | 5173 | | |
5143 | 5174 | | |
5144 | | - | |
| 5175 | + | |
5145 | 5176 | | |
5146 | 5177 | | |
5147 | 5178 | | |
5148 | 5179 | | |
5149 | | - | |
| 5180 | + | |
5150 | 5181 | | |
5151 | 5182 | | |
5152 | 5183 | | |
| |||
0 commit comments