diff options
| author | Harry Yoo (Oracle) <harry@kernel.org> | 2026-07-29 17:20:10 +0900 |
|---|---|---|
| committer | Vlastimil Babka (SUSE) <vbabka@kernel.org> | 2026-07-31 15:56:32 +0200 |
| commit | f3521fbec2b2839698eba2b7013ed20119416e6d (patch) | |
| tree | 3aded772bcf85bddcd05ea40b6f41e02f9305624 /scripts/stackusage | |
| parent | b0c4582862c2feae7c9d49fe77aff6215cd1cea9 (diff) | |
| download | linux-next-f3521fbec2b2839698eba2b7013ed20119416e6d.tar.gz linux-next-f3521fbec2b2839698eba2b7013ed20119416e6d.zip | |
mm/slab: handle the !allow_spin case in kfree_rcu_sheaf()
Teach kfree_rcu_sheaf() how to handle the !allow_spin case. Try to get
an empty sheaf from pcs->spare or the barn even when spinning is not
allowed. Unlike __pcs_replace_full_main(), try harder to allocate
an empty sheaf because the fallback path will be more expensive than
kfree_nolock().
Now that slab has internal alloc_flags to describe context, introduce
free_flags analogously and convert free_flags to alloc_flags when
allocating memory in the free path.
When trylock fails or the kernel observes non-NULL pcs->rcu_free after
lock acquisition, free the sheaf instead of putting it to the barn.
This is rare and not worth complicating the code.
Since call_rcu() cannot be called in an unknown context,
kfree_rcu_sheaf() fails when the rcu sheaf becomes full.
Link: https://lore.kernel.org/linux-mm/872bd673-3d45-4111-8a41-31185db3ece5@kernel.org
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Harry Yoo (Oracle) <harry@kernel.org>
Link: https://patch.msgid.link/20260729-kfree_rcu_nolock-v5-2-a28cdcda9673@kernel.org
Reviewed-by: Shengming Hu <hu.shengming@zte.com.cn>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
