Commit e519ce7
mm/slub: add sanity check for slub_min/max_order cmdline setup
Currently there are 2 parameters could be setup from kernel cmdline:
slub_min_order and slub_max_order. It's possible that the user
configured slub_min_order is bigger than the default slub_max_order
[1], which can still take effect, as calculate_oder() will use MAX_ORDER
as a fallback to check against, but has some downsides:
* the kernel message about SLUB will be strange in showing min/max
orders:
SLUB: HWalign=64, Order=9-3, MinObjects=0, CPUs=16, Nodes=1
* in calculate_order() called by each slab, the 2 loops of
calc_slab_order() will all be meaningless due to slub_min_order
is bigger than slub_max_order
* prevent future code cleanup like in [2].
Fix it by adding some sanity check to enforce the min/max semantics.
[1]. https://lore.kernel.org/lkml/21a0ba8b-bf05-0799-7c78-2a35f8c8d52a@os.amperecomputing.com/
[2]. https://lore.kernel.org/lkml/20230908145302.30320-7-vbabka@suse.cz/
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>1 parent 8a749fd commit e519ce7
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4711 | 4711 | | |
4712 | 4712 | | |
4713 | 4713 | | |
| 4714 | + | |
| 4715 | + | |
| 4716 | + | |
4714 | 4717 | | |
4715 | 4718 | | |
4716 | 4719 | | |
| |||
4721 | 4724 | | |
4722 | 4725 | | |
4723 | 4726 | | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
4724 | 4730 | | |
4725 | 4731 | | |
4726 | 4732 | | |
| |||
0 commit comments