aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mpi/mpi-scan.c
diff options
context:
space:
mode:
authorVlastimil Babka <[email protected]>2025-10-23 12:01:07 +0000
committerVlastimil Babka <[email protected]>2025-10-23 14:53:21 +0000
commiteecd7cb64178efb35f89aa5134cf6ce36c0c66db (patch)
tree22f537fdeb564d05c28f43f8374c7a0974ef9441 /lib/mpi/mpi-scan.c
parentslab: Avoid race on slab->obj_exts in alloc_slab_obj_exts (diff)
downloadkernel-eecd7cb64178efb35f89aa5134cf6ce36c0c66db.tar.gz
kernel-eecd7cb64178efb35f89aa5134cf6ce36c0c66db.zip
slab: fix slab accounting imbalance due to defer_deactivate_slab()
Since commit af92793e52c3 ("slab: Introduce kmalloc_nolock() and kfree_nolock().") there's a possibility in alloc_single_from_new_slab() that we discard the newly allocated slab if we can't spin and we fail to trylock. As a result we don't perform inc_slabs_node() later in the function. Instead we perform a deferred deactivate_slab() which can either put the unacounted slab on partial list, or discard it immediately while performing dec_slabs_node(). Either way will cause an accounting imbalance. Fix this by not marking the slab as frozen, and using free_slab() instead of deactivate_slab() for non-frozen slabs in free_deferred_objects(). For CONFIG_SLUB_TINY, that's the only possible case. By not using discard_slab() we avoid dec_slabs_node(). Fixes: af92793e52c3 ("slab: Introduce kmalloc_nolock() and kfree_nolock().") Link: https://patch.msgid.link/[email protected] Reviewed-by: Harry Yoo <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-scan.c')
0 files changed, 0 insertions, 0 deletions