summaryrefslogtreecommitdiffstats
path: root/include/linux/ref_tracker.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2022-02-04 14:42:36 -0800
committerDavid S. Miller <davem@davemloft.net>2022-02-05 15:22:44 +0000
commit8fd5522f44dcd7f05454ddc4f16d0f821b676cd9 (patch)
treeb9899897b9d8687f629833d4ac7d58a3f9239f22 /include/linux/ref_tracker.h
parente3ececfe668facd87d920b608349a32607060e66 (diff)
downloadlinux-stable-8fd5522f44dcd7f05454ddc4f16d0f821b676cd9.tar.gz
linux-stable-8fd5522f44dcd7f05454ddc4f16d0f821b676cd9.tar.bz2
linux-stable-8fd5522f44dcd7f05454ddc4f16d0f821b676cd9.zip
ref_tracker: add a count of untracked references
We are still chasing a netdev refcount imbalance, and we suspect we have one rogue dev_put() that is consuming a reference taken from a dev_hold_track() To detect this case, allow ref_tracker_alloc() and ref_tracker_free() to be called with a NULL @trackerp parameter, and use a dedicated refcount_t just for them. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ref_tracker.h')
-rw-r--r--include/linux/ref_tracker.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/ref_tracker.h b/include/linux/ref_tracker.h
index a443abda937d..9ca353ab712b 100644
--- a/include/linux/ref_tracker.h
+++ b/include/linux/ref_tracker.h
@@ -13,6 +13,7 @@ struct ref_tracker_dir {
spinlock_t lock;
unsigned int quarantine_avail;
refcount_t untracked;
+ refcount_t no_tracker;
bool dead;
struct list_head list; /* List of active trackers */
struct list_head quarantine; /* List of dead trackers */
@@ -29,6 +30,7 @@ static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
dir->quarantine_avail = quarantine_count;
dir->dead = false;
refcount_set(&dir->untracked, 1);
+ refcount_set(&dir->no_tracker, 1);
stack_depot_init();
}