Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ref_tracker: add a static classname string to each ref_tracker_dir

A later patch in the series will be adding debugfs files for each
ref_tracker that get created in ref_tracker_dir_init(). The format will
be "class@%px". The current "name" string can vary between
ref_tracker_dir objects of the same type, so it's not suitable for this
purpose.

Add a new "class" string to the ref_tracker dir that describes the
the type of object (sans any individual info for that object).

Also, in the i915 driver, gate the creation of debugfs files on whether
the dentry pointer is still set to NULL. CI has shown that the
ref_tracker_dir can be initialized more than once.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-4-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jeff Layton and committed by
Jakub Kicinski
aa7d26c3 49c94af0

+14 -7
+1 -1
drivers/gpu/drm/display/drm_dp_tunnel.c
··· 1920 1920 } 1921 1921 1922 1922 #ifdef CONFIG_DRM_DISPLAY_DP_TUNNEL_STATE_DEBUG 1923 - ref_tracker_dir_init(&mgr->ref_tracker, 16, "dptun"); 1923 + ref_tracker_dir_init(&mgr->ref_tracker, 16, "drm_dptun", "dptun"); 1924 1924 #endif 1925 1925 1926 1926 for (i = 0; i < max_group_count; i++) {
+3 -1
drivers/gpu/drm/i915/intel_runtime_pm.c
··· 59 59 60 60 static void init_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm) 61 61 { 62 - ref_tracker_dir_init(&rpm->debug, INTEL_REFTRACK_DEAD_COUNT, dev_name(rpm->kdev)); 62 + if (!rpm->debug.class) 63 + ref_tracker_dir_init(&rpm->debug, INTEL_REFTRACK_DEAD_COUNT, 64 + "intel_runtime_pm", dev_name(rpm->kdev)); 63 65 } 64 66 65 67 static intel_wakeref_t
+2 -1
drivers/gpu/drm/i915/intel_wakeref.c
··· 114 114 "wakeref.work", &key->work, 0); 115 115 116 116 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_WAKEREF) 117 - ref_tracker_dir_init(&wf->debug, INTEL_REFTRACK_DEAD_COUNT, name); 117 + if (!wf->debug.class) 118 + ref_tracker_dir_init(&wf->debug, INTEL_REFTRACK_DEAD_COUNT, "intel_wakeref", name); 118 119 #endif 119 120 } 120 121
+4
include/linux/ref_tracker.h
··· 19 19 bool dead; 20 20 struct list_head list; /* List of active trackers */ 21 21 struct list_head quarantine; /* List of dead trackers */ 22 + const char *class; /* object classname */ 22 23 char name[32]; 23 24 #endif 24 25 }; ··· 28 27 29 28 static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir, 30 29 unsigned int quarantine_count, 30 + const char *class, 31 31 const char *name) 32 32 { 33 33 INIT_LIST_HEAD(&dir->list); ··· 38 36 dir->dead = false; 39 37 refcount_set(&dir->untracked, 1); 40 38 refcount_set(&dir->no_tracker, 1); 39 + dir->class = class; 41 40 strscpy(dir->name, name, sizeof(dir->name)); 42 41 stack_depot_init(); 43 42 } ··· 63 60 64 61 static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir, 65 62 unsigned int quarantine_count, 63 + const char *class, 66 64 const char *name) 67 65 { 68 66 }
+1 -1
lib/test_ref_tracker.c
··· 64 64 { 65 65 int i; 66 66 67 - ref_tracker_dir_init(&ref_dir, 100, "selftest"); 67 + ref_tracker_dir_init(&ref_dir, 100, "selftest", "selftest"); 68 68 69 69 timer_setup(&test_ref_tracker_timer, test_ref_tracker_timer_func, 0); 70 70 mod_timer(&test_ref_tracker_timer, jiffies + 1);
+1 -1
net/core/dev.c
··· 11715 11715 11716 11716 dev->priv_len = sizeof_priv; 11717 11717 11718 - ref_tracker_dir_init(&dev->refcnt_tracker, 128, name); 11718 + ref_tracker_dir_init(&dev->refcnt_tracker, 128, "netdev", name); 11719 11719 #ifdef CONFIG_PCPU_DEV_REFCNT 11720 11720 dev->pcpu_refcnt = alloc_percpu(int); 11721 11721 if (!dev->pcpu_refcnt)
+2 -2
net/core/net_namespace.c
··· 403 403 { 404 404 refcount_set(&net->passive, 1); 405 405 refcount_set(&net->ns.count, 1); 406 - ref_tracker_dir_init(&net->refcnt_tracker, 128, "net refcnt"); 407 - ref_tracker_dir_init(&net->notrefcnt_tracker, 128, "net notrefcnt"); 406 + ref_tracker_dir_init(&net->refcnt_tracker, 128, "net_refcnt", "net_refcnt"); 407 + ref_tracker_dir_init(&net->notrefcnt_tracker, 128, "net_notrefcnt", "net_notrefcnt"); 408 408 409 409 get_random_bytes(&net->hash_mix, sizeof(u32)); 410 410 net->dev_base_seq = 1;