]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kfence: save freeing stack trace at calling time instead of freeing time
authorTianchen Ding <dtcccc@linux.alibaba.com>
Mon, 12 Aug 2024 09:55:17 +0000 (17:55 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:53:12 +0000 (17:53 -0700)
commite5f3390304490ef52b2bb1df615186cd3bad1332
tree9f35a771daafaa7944750a651b31448884694ce7
parent50e4fa6da3cb26490eb5d67b0809f46be23efed1
kfence: save freeing stack trace at calling time instead of freeing time

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>
mm/kfence/core.c
mm/kfence/kfence.h
mm/kfence/report.c