Skip to content
Snippets Groups Projects
Commit 825bccd9 authored by Shakeel Butt's avatar Shakeel Butt Committed by Greg Kroah-Hartman
Browse files

memcg: slub: fix SUnreclaim for post charged objects


commit b7ffecbe198e2dfc44abf92ceb90f46150f7527a upstream.

Large kmalloc directly allocates from the page allocator and then use
lruvec_stat_mod_folio() to increment the unreclaimable slab stats for
global and memcg. However when post memcg charging of slab objects was
added in commit 9028cdeb ("memcg: add charging of already allocated
slab objects"), it missed to correctly handle the unreclaimable slab
stats for memcg.

One user visisble effect of that bug is that the node level
unreclaimable slab stat will work correctly but the memcg level stat can
underflow as kernel correctly handles the free path but the charge path
missed to increment the memcg level unreclaimable slab stat. Let's fix
by correctly handle in the post charge code path.

Fixes: 9028cdeb ("memcg: add charging of already allocated slab objects")
Signed-off-by: default avatarShakeel Butt <shakeel.butt@linux.dev>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6e564f2a
No related branches found
No related tags found
1 merge request!181🤖 Sync Bot: Update v6.12-ktn to Latest Stable Kernel (v6.12.9)
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment