deepin-kernel/mm/kfence
Tianchen Ding db5216c288 kfence: save freeing stack trace at calling time instead of freeing time
commit c36be0cdf6 upstream.

For kmem_cache with SLAB_TYPESAFE_BY_RCU, the freeing trace stack at
calling kmem_cache_free() is more useful. While the following stack is
meaningless and provides no help:
  freed by task 46 on cpu 0 at 656.840729s:
   rcu_do_batch+0x1ab/0x540
   nocb_cb_wait+0x8f/0x260
   rcu_nocb_cb_kthread+0x25/0x80
   kthread+0xd2/0x100
   ret_from_fork+0x34/0x50
   ret_from_fork_asm+0x1a/0x30

Link: https://lkml.kernel.org/r/20240812095517.2357-1-dtcccc@linux.alibaba.com
Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
[ Backport from v6.12-rc1 ]
Link: https://gitee.com/anolis/cloud-kernel/pulls/3901
Signed-off-by: WangYuli <wangyuli@uniontech.com>
2025-07-02 15:47:33 +08:00
..
.kunitconfig kfence: test: use new suite_{init/exit} support, add .kunitconfig 2022-05-02 12:35:57 -06:00
Makefile kfence: avoid passing -g for test 2023-03-23 17:18:35 -07:00
core.c kfence: save freeing stack trace at calling time instead of freeing time 2025-07-02 15:47:33 +08:00
kfence.h kfence: save freeing stack trace at calling time instead of freeing time 2025-07-02 15:47:33 +08:00
kfence_test.c Randomized slab caches for kmalloc() 2023-07-18 10:07:47 +02:00
report.c kfence: save freeing stack trace at calling time instead of freeing time 2025-07-02 15:47:33 +08:00