Commit 61aa3c8
mm/slub: refactor calculate_order() and calc_slab_order()
mainline inclusion
from mainline-v6.7-rc1
category: other
After the previous cleanups, we can now move some code from
calc_slab_order() to calculate_order() so it's executed just once, and
do some more cleanups.
- move the min_order and MAX_OBJS_PER_PAGE evaluation to
calculate_order().
- change calc_slab_order() parameter min_objects to min_order
Also make MAX_OBJS_PER_PAGE check more robust by considering also
min_objects in addition to slub_min_order. Otherwise this is not a
functional change.
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Feng Tang <feng.tang@intel.com>
Reviewed-and-tested-by: Jay Patel <jaypatel@linux.ibm.com>
(cherry picked from commit 90f055d)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>1 parent a36005a commit 61aa3c8
1 file changed
Lines changed: 12 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4278 | 4278 | | |
4279 | 4279 | | |
4280 | 4280 | | |
4281 | | - | |
| 4281 | + | |
4282 | 4282 | | |
4283 | 4283 | | |
4284 | | - | |
4285 | 4284 | | |
4286 | 4285 | | |
4287 | | - | |
4288 | | - | |
4289 | | - | |
4290 | | - | |
4291 | | - | |
| 4286 | + | |
4292 | 4287 | | |
4293 | 4288 | | |
4294 | 4289 | | |
| |||
4307 | 4302 | | |
4308 | 4303 | | |
4309 | 4304 | | |
4310 | | - | |
| 4305 | + | |
4311 | 4306 | | |
4312 | 4307 | | |
4313 | 4308 | | |
| |||
4320 | 4315 | | |
4321 | 4316 | | |
4322 | 4317 | | |
4323 | | - | |
| 4318 | + | |
4324 | 4319 | | |
4325 | 4320 | | |
4326 | 4321 | | |
4327 | 4322 | | |
4328 | | - | |
| 4323 | + | |
| 4324 | + | |
4329 | 4325 | | |
4330 | 4326 | | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
4331 | 4332 | | |
4332 | 4333 | | |
4333 | 4334 | | |
| |||
4344 | 4345 | | |
4345 | 4346 | | |
4346 | 4347 | | |
4347 | | - | |
| 4348 | + | |
4348 | 4349 | | |
4349 | 4350 | | |
4350 | 4351 | | |
| |||
0 commit comments