lib: add reference counting tracking infrastructure
It can be hard to track where references are taken and released. In networking, we have annoying issues at device or netns dismantles, and we had various proposals to ease root causing them. This patch adds new infrastructure pairing refcount increases and decreases. This will self document code, because programmers will have to associate increments/decrements. This is controled by CONFIG_REF_TRACKER which can be selected by users of this feature. This adds both cpu and memory costs, and thus should probably be used with care. Signed-off-by: NEric Dumazet <edumazet@google.com> Reviewed-by: NDmitry Vyukov <dvyukov@google.com> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
Showing
include/linux/ref_tracker.h
0 → 100644
lib/ref_tracker.c
0 → 100644
想要评论请 注册 或 登录