]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm, slab: clean up slab->obj_exts always
authorZhenhua Huang <quic_zhenhuah@quicinc.com>
Mon, 21 Apr 2025 07:52:32 +0000 (15:52 +0800)
committerVlastimil Babka <vbabka@suse.cz>
Thu, 24 Apr 2025 17:19:40 +0000 (19:19 +0200)
commitbe8250786ca94952a19ce87f98ad9906448bc9ef
tree0e6a4606e70eec3d5b908cffdf4925108789611d
parentd2f5819b6ed357c0c350c0616b6b9f38be59adf6
mm, slab: clean up slab->obj_exts always

When memory allocation profiling is disabled at runtime or due to an
error, shutdown_mem_profiling() is called: slab->obj_exts which
previously allocated remains.
It won't be cleared by unaccount_slab() because of
mem_alloc_profiling_enabled() not true. It's incorrect, slab->obj_exts
should always be cleaned up in unaccount_slab() to avoid following error:

[...]BUG: Bad page state in process...
..
[...]page dumped because: page still charged to cgroup

[andriy.shevchenko@linux.intel.com: fold need_slab_obj_ext() into its only user]
Fixes: 21c690a349ba ("mm: introduce slabobj_ext to support slab object extensions")
Cc: stable@vger.kernel.org
Signed-off-by: Zhenhua Huang <quic_zhenhuah@quicinc.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Harry Yoo <harry.yoo@oracle.com>
Tested-by: Harry Yoo <harry.yoo@oracle.com>
Acked-by: Suren Baghdasaryan <surenb@google.com>
Link: https://patch.msgid.link/20250421075232.2165527-1-quic_zhenhuah@quicinc.com
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slub.c