diff options
| author | Vlastimil Babka (SUSE) <vbabka@kernel.org> | 2026-07-07 14:16:00 +0200 |
|---|---|---|
| committer | Vlastimil Babka (SUSE) <vbabka@kernel.org> | 2026-07-10 13:38:38 +0200 |
| commit | e1fa26489025d6deac76d1dbfe2e0720a3ad84b1 (patch) | |
| tree | ac15595eafaaf77bb72fb131d9820240b1dbac6f /scripts/stackusage | |
| parent | bfec5d0b393f56b2f0ca42f50ee9939a9b3999d0 (diff) | |
| download | linux-next-e1fa26489025d6deac76d1dbfe2e0720a3ad84b1.tar.gz linux-next-e1fa26489025d6deac76d1dbfe2e0720a3ad84b1.zip | |
mm/slab: extract __free_to_pcs_batch() from free_to_pcs_bulk()
It has been noted that free_to_pcs_bulk() is difficult to follow, with a
number of goto labels, and this has contributed to two memory leak bugs
in there.
Extract part of the code to __free_to_pcs_batch(), which focuses only on
freeing free-hook-processed local objects to a percpu sheaf, and
returning how many were freed. Zero means a trylock failure or no empty
sheaf available, and thus the caller should fallback to
__kmem_cache_free_bulk().
Make free_to_pcs_bulk() call this in a while loop, removing all goto
labels from the function. __free_to_pcs_batch() retains two rather
straightforward ones.
Reviewed-by: Shengming Hu <hu.shengming@zte.com.cn>
Link: https://patch.msgid.link/20260707-slab-simplify-bulk-pcs-v1-1-4850dbe0d904@kernel.org
Reviewed-by: Hao Li <hao.li@linux.dev>
Reviewed-by: Harry Yoo (Oracle) <harry@kernel.org>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
