]> git.baikalelectronics.ru Git - kernel.git/commit
lib: add reference counting tracking infrastructure
authorEric Dumazet <edumazet@google.com>
Sun, 5 Dec 2021 04:21:55 +0000 (20:21 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 7 Dec 2021 00:04:44 +0000 (16:04 -0800)
commita7794fb578188f49830098b2f8a67c2fc1dee754
treefc56c9432018c4128c6462cc5f970bd2212aab9d
parent7b4d1a38af53cb03c69b1489766cf4555132682d
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: Eric Dumazet <edumazet@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/ref_tracker.h [new file with mode: 0644]
lib/Kconfig
lib/Makefile
lib/ref_tracker.c [new file with mode: 0644]