summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorHao Li <hao.li@linux.dev>2026-09-21 20:43:22 +0800
committerHarry Yoo (Meta) <harry@kernel.org>2026-09-21 15:57:41 +0100
commit6932405b8154dd996b892a8a444a5543bb2bc35c (patch)
tree8d9a9c08b964da872301e94e92e1aa77e6a6faf3 /tools/lib/python
parent0710b29e51efbc7ad2567df429492f86349dd4d8 (diff)
downloadlinux-next-6932405b8154dd996b892a8a444a5543bb2bc35c.tar.gz
linux-next-6932405b8154dd996b892a8a444a5543bb2bc35c.zip
mm/slub: make the case handling in __slab_free() easier to follow
There are 8 possible transitions in __slab_free(): a. partial->partial, offlist b. partial->partial, onlist c. partial->empty, offlist d. partial->empty, onlist, exceeding min_partial e. partial->empty, onlist, not exceeding min_partial f. full->empty, exceeding min_partial g. full->empty, not exceeding min_partial h. full->partial (The onlist/offlist distinction does not apply to f, g and h, as a full slab is on no list.) Clarify which case each branch handles, and replace the goto with a return at the end of the skipped block so that every branch explicitly states its coverage. Cases 'a' and 'b' are the only paths that need neither list_lock nor list handling. Give them an early continue: handling them upfront is much clearer than forcing every other case into a nested block. Also, read SL_partial once after the loop right where it is used, rather than re-reading it on every iteration. No functional change. Signed-off-by: Hao Li <hao.li@linux.dev> Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Reviewed-by: Harry Yoo (Meta) <harry@kernel.org> Link: https://patch.msgid.link/20260921125421.142452-1-hao.li@linux.dev Signed-off-by: Harry Yoo (Meta) <harry@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions