* [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir
@ 2025-04-30 15:06 Jeff Layton
2025-04-30 15:06 ` [PATCH v6 01/10] ref_tracker: don't use %pK in pr_ostream() output Jeff Layton
` (9 more replies)
0 siblings, 10 replies; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton,
Thomas Weißschuh
This one is quite a bit of a change from the last set. I've gone back to
auto-registering the debugfs files for every ref_tracker_dir. With this,
the callers should pass in a static string as a classname instead of an
individual name string that gets copied. The debugfs file is given a
name "class@%px" The output format is switched to print "class@%p"
instead of "name@%p".
To allow for human-readable names, I've added the ability to add a
symlink in the debugfs dir that can be set to an arbitrary name. This is
optional. I've only added them to the netns and i915 trackers in this
series.
Finally, with the above changes, we can eliminate the "name" field in
the ref_tracker_dir which shrinks it by 16 bytes on a 64 bit host.
The original plan was to merge this via the networking tree. That's
probably still doable but there are some display port and i915 changes
in here too. Note that those are untested, mostly because I don't have
the necessary hardware handy.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Changes in v6:
- clean up kerneldoc comment for ref_tracker_dir_debugfs()
- add missing stub function for ref_tracker_dir_symlink()
- temporary __maybe_unused on ref_tracker_dir_seq_print() to silence compiler warning
- Link to v5: https://lore.kernel.org/r/20250428-reftrack-dbgfs-v5-0-1cbbdf2038bd@kernel.org
Changes in v5:
- add class string to each ref_tracker_dir
- auto-register debugfs file for every tracker in ref_tracker_dir_init
- add function to allow adding a symlink for each tracker
- add patches to create symlinks for netns's and i915 entries
- change output format to print class@%p instead of name@%p
- eliminate the name field in ref_tracker_dir
- fix off-by-one bug when NULL terminating name string
- Link to v4: https://lore.kernel.org/r/20250418-reftrack-dbgfs-v4-0-5ca5c7899544@kernel.org
Changes in v4:
- Drop patch to widen ref_tracker_dir_.name, use NAME_MAX+1 (256) instead since this only affects dentry name
- Link to v3: https://lore.kernel.org/r/20250417-reftrack-dbgfs-v3-0-c3159428c8fb@kernel.org
Changes in v3:
- don't overwrite dir->name in ref_tracker_dir_debugfs
- define REF_TRACKER_NAMESZ and use it when setting name
- Link to v2: https://lore.kernel.org/r/20250415-reftrack-dbgfs-v2-0-b18c4abd122f@kernel.org
Changes in v2:
- Add patch to do %pK -> %p conversion in ref_tracker.c
- Pass in output function to pr_ostream() instead of if statement
- Widen ref_tracker_dir.name to 64 bytes to accomodate unique names
- Eliminate error handling with debugfs manipulation
- Incorporate pointer value into netdev name
- Link to v1: https://lore.kernel.org/r/20250414-reftrack-dbgfs-v1-0-f03585832203@kernel.org
---
Jeff Layton (10):
ref_tracker: don't use %pK in pr_ostream() output
ref_tracker: add a top level debugfs directory for ref_tracker
ref_tracker: have callers pass output function to pr_ostream()
ref_tracker: add a static classname string to each ref_tracker_dir
ref_tracker: allow pr_ostream() to print directly to a seq_file
ref_tracker: automatically register a file in debugfs for a ref_tracker_dir
ref_tracker: add a way to create a symlink to the ref_tracker_dir debugfs file
net: add symlinks to ref_tracker_dir for netns
i915: add ref_tracker_dir symlinks for each tracker
ref_tracker: eliminate the ref_tracker_dir name field
drivers/gpu/drm/display/drm_dp_tunnel.c | 2 +-
drivers/gpu/drm/i915/intel_runtime_pm.c | 4 +-
drivers/gpu/drm/i915/intel_wakeref.c | 3 +-
include/linux/ref_tracker.h | 44 +++++++-
lib/ref_tracker.c | 192 +++++++++++++++++++++++++++++---
net/core/dev.c | 2 +-
net/core/net_namespace.c | 32 +++++-
7 files changed, 253 insertions(+), 26 deletions(-)
---
base-commit: 5bc1018675ec28a8a60d83b378d8c3991faa5a27
change-id: 20250413-reftrack-dbgfs-3767b303e2fa
Best regards,
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v6 01/10] ref_tracker: don't use %pK in pr_ostream() output
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
@ 2025-04-30 15:06 ` Jeff Layton
2025-04-30 15:06 ` [PATCH v6 02/10] ref_tracker: add a top level debugfs directory for ref_tracker Jeff Layton
` (8 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton,
Thomas Weißschuh
As Thomas Weißschuh points out [1], it is now preferable to use %p
instead of hashed pointers with printk(), since raw pointers should no
longer be leaked into the kernel log. Change the ref_tracker
infrastructure to use %p instead of %pK in its formats.
[1]: https://lore.kernel.org/netdev/20250414-restricted-pointers-net-v1-0-12af0ce46cdd@linutronix.de/
Cc: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
lib/ref_tracker.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c
index cf5609b1ca79361763abe5a3a98484a3ee591ff2..de71439e12a3bab6456910986fa611dfbdd97980 100644
--- a/lib/ref_tracker.c
+++ b/lib/ref_tracker.c
@@ -96,7 +96,7 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir,
stats = ref_tracker_get_stats(dir, display_limit);
if (IS_ERR(stats)) {
- pr_ostream(s, "%s@%pK: couldn't get stats, error %pe\n",
+ pr_ostream(s, "%s@%p: couldn't get stats, error %pe\n",
dir->name, dir, stats);
return;
}
@@ -107,13 +107,13 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir,
stack = stats->stacks[i].stack_handle;
if (sbuf && !stack_depot_snprint(stack, sbuf, STACK_BUF_SIZE, 4))
sbuf[0] = 0;
- pr_ostream(s, "%s@%pK has %d/%d users at\n%s\n", dir->name, dir,
+ pr_ostream(s, "%s@%p has %d/%d users at\n%s\n", dir->name, dir,
stats->stacks[i].count, stats->total, sbuf);
skipped -= stats->stacks[i].count;
}
if (skipped)
- pr_ostream(s, "%s@%pK skipped reports about %d/%d users.\n",
+ pr_ostream(s, "%s@%p skipped reports about %d/%d users.\n",
dir->name, dir, skipped, stats->total);
kfree(sbuf);
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v6 02/10] ref_tracker: add a top level debugfs directory for ref_tracker
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
2025-04-30 15:06 ` [PATCH v6 01/10] ref_tracker: don't use %pK in pr_ostream() output Jeff Layton
@ 2025-04-30 15:06 ` Jeff Layton
2025-04-30 15:06 ` [PATCH v6 03/10] ref_tracker: have callers pass output function to pr_ostream() Jeff Layton
` (7 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton
Add a new "ref_tracker" directory in debugfs. Each individual refcount
tracker can register files under there to display info about
currently-held references.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
lib/ref_tracker.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c
index de71439e12a3bab6456910986fa611dfbdd97980..a66cde325920780cfe7529ea9d827d0ee943318d 100644
--- a/lib/ref_tracker.c
+++ b/lib/ref_tracker.c
@@ -12,6 +12,8 @@
#define REF_TRACKER_STACK_ENTRIES 16
#define STACK_BUF_SIZE 1024
+static struct dentry *ref_tracker_debug_dir = (struct dentry *)-ENOENT;
+
struct ref_tracker {
struct list_head head; /* anchor into dir->list or dir->quarantine */
bool dead;
@@ -273,3 +275,17 @@ int ref_tracker_free(struct ref_tracker_dir *dir,
return 0;
}
EXPORT_SYMBOL_GPL(ref_tracker_free);
+
+#ifdef CONFIG_DEBUG_FS
+#include <linux/debugfs.h>
+
+static int __init ref_tracker_debugfs_init(void)
+{
+ ref_tracker_debug_dir = debugfs_create_dir("ref_tracker", NULL);
+ if (IS_ERR(ref_tracker_debug_dir))
+ pr_warn("ref_tracker: unable to create debugfs ref_tracker directory: %pe\n",
+ ref_tracker_debug_dir);
+ return 0;
+}
+late_initcall(ref_tracker_debugfs_init);
+#endif /* CONFIG_DEBUG_FS */
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v6 03/10] ref_tracker: have callers pass output function to pr_ostream()
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
2025-04-30 15:06 ` [PATCH v6 01/10] ref_tracker: don't use %pK in pr_ostream() output Jeff Layton
2025-04-30 15:06 ` [PATCH v6 02/10] ref_tracker: add a top level debugfs directory for ref_tracker Jeff Layton
@ 2025-04-30 15:06 ` Jeff Layton
2025-04-30 15:06 ` [PATCH v6 04/10] ref_tracker: add a static classname string to each ref_tracker_dir Jeff Layton
` (6 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton
In a later patch, we'll be adding a 3rd mechanism for outputting
ref_tracker info via seq_file. Instead of a conditional, have the caller
set a pointer to an output function in struct ostream. As part of this,
the log prefix must be explicitly passed in, as it's too late for the
pr_fmt macro.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
lib/ref_tracker.c | 53 ++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 38 insertions(+), 15 deletions(-)
diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c
index a66cde325920780cfe7529ea9d827d0ee943318d..b6e0a87dd75eddef4d504419c0cf398ea65c19d8 100644
--- a/lib/ref_tracker.c
+++ b/lib/ref_tracker.c
@@ -64,22 +64,40 @@ ref_tracker_get_stats(struct ref_tracker_dir *dir, unsigned int limit)
return stats;
}
+#define __ostream_printf __printf(2, 3)
+
struct ostream {
+ void __ostream_printf (*func)(struct ostream *stream, char *fmt, ...);
+ char *prefix;
char *buf;
int size, used;
};
+static void __ostream_printf pr_ostream_log(struct ostream *stream, char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ vprintk(fmt, args);
+ va_end(args);
+}
+
+static void __ostream_printf pr_ostream_buf(struct ostream *stream, char *fmt, ...)
+{
+ int ret, len = stream->size - stream->used;
+ va_list args;
+
+ va_start(args, fmt);
+ ret = vsnprintf(stream->buf + stream->used, len, fmt, args);
+ va_end(args);
+ stream->used += min(ret, len);
+}
+
#define pr_ostream(stream, fmt, args...) \
({ \
struct ostream *_s = (stream); \
\
- if (!_s->buf) { \
- pr_err(fmt, ##args); \
- } else { \
- int ret, len = _s->size - _s->used; \
- ret = snprintf(_s->buf + _s->used, len, pr_fmt(fmt), ##args); \
- _s->used += min(ret, len); \
- } \
+ _s->func(_s, fmt, ##args); \
})
static void
@@ -98,8 +116,8 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir,
stats = ref_tracker_get_stats(dir, display_limit);
if (IS_ERR(stats)) {
- pr_ostream(s, "%s@%p: couldn't get stats, error %pe\n",
- dir->name, dir, stats);
+ pr_ostream(s, "%s%s@%p: couldn't get stats, error %pe\n",
+ s->prefix, dir->name, dir, stats);
return;
}
@@ -109,14 +127,15 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir,
stack = stats->stacks[i].stack_handle;
if (sbuf && !stack_depot_snprint(stack, sbuf, STACK_BUF_SIZE, 4))
sbuf[0] = 0;
- pr_ostream(s, "%s@%p has %d/%d users at\n%s\n", dir->name, dir,
- stats->stacks[i].count, stats->total, sbuf);
+ pr_ostream(s, "%s%s@%p has %d/%d users at\n%s\n", s->prefix,
+ dir->name, dir, stats->stacks[i].count,
+ stats->total, sbuf);
skipped -= stats->stacks[i].count;
}
if (skipped)
- pr_ostream(s, "%s@%p skipped reports about %d/%d users.\n",
- dir->name, dir, skipped, stats->total);
+ pr_ostream(s, "%s%s@%p skipped reports about %d/%d users.\n",
+ s->prefix, dir->name, dir, skipped, stats->total);
kfree(sbuf);
@@ -126,7 +145,8 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir,
void ref_tracker_dir_print_locked(struct ref_tracker_dir *dir,
unsigned int display_limit)
{
- struct ostream os = {};
+ struct ostream os = { .func = pr_ostream_log,
+ .prefix = "ref_tracker: " };
__ref_tracker_dir_pr_ostream(dir, display_limit, &os);
}
@@ -145,7 +165,10 @@ EXPORT_SYMBOL(ref_tracker_dir_print);
int ref_tracker_dir_snprint(struct ref_tracker_dir *dir, char *buf, size_t size)
{
- struct ostream os = { .buf = buf, .size = size };
+ struct ostream os = { .func = pr_ostream_buf,
+ .prefix = "ref_tracker: ",
+ .buf = buf,
+ .size = size };
unsigned long flags;
spin_lock_irqsave(&dir->lock, flags);
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v6 04/10] ref_tracker: add a static classname string to each ref_tracker_dir
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
` (2 preceding siblings ...)
2025-04-30 15:06 ` [PATCH v6 03/10] ref_tracker: have callers pass output function to pr_ostream() Jeff Layton
@ 2025-04-30 15:06 ` Jeff Layton
2025-04-30 15:06 ` [PATCH v6 05/10] ref_tracker: allow pr_ostream() to print directly to a seq_file Jeff Layton
` (5 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton
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).
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
drivers/gpu/drm/display/drm_dp_tunnel.c | 2 +-
drivers/gpu/drm/i915/intel_runtime_pm.c | 3 ++-
drivers/gpu/drm/i915/intel_wakeref.c | 2 +-
include/linux/ref_tracker.h | 4 ++++
lib/test_ref_tracker.c | 2 +-
net/core/dev.c | 2 +-
net/core/net_namespace.c | 4 ++--
7 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_dp_tunnel.c b/drivers/gpu/drm/display/drm_dp_tunnel.c
index 90fe07a89260e21e78f2db7f57a90602be921a11..f2a8ef6abf34d89a642d7c7708c41e5b1dc9dece 100644
--- a/drivers/gpu/drm/display/drm_dp_tunnel.c
+++ b/drivers/gpu/drm/display/drm_dp_tunnel.c
@@ -1920,7 +1920,7 @@ drm_dp_tunnel_mgr_create(struct drm_device *dev, int max_group_count)
}
#ifdef CONFIG_DRM_DISPLAY_DP_TUNNEL_STATE_DEBUG
- ref_tracker_dir_init(&mgr->ref_tracker, 16, "dptun");
+ ref_tracker_dir_init(&mgr->ref_tracker, 16, "drm_dptun", "dptun");
#endif
for (i = 0; i < max_group_count; i++) {
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 8d9f4c410546e4144d4bc8bbc6696f3bd9498848..3fdab3b44c08cea16ac2f73aafc2bea2ffbb19e7 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -59,7 +59,8 @@ static struct drm_i915_private *rpm_to_i915(struct intel_runtime_pm *rpm)
static void init_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm)
{
- ref_tracker_dir_init(&rpm->debug, INTEL_REFTRACK_DEAD_COUNT, dev_name(rpm->kdev));
+ ref_tracker_dir_init(&rpm->debug, INTEL_REFTRACK_DEAD_COUNT,
+ "intel_runtime_pm", dev_name(rpm->kdev));
}
static intel_wakeref_t
diff --git a/drivers/gpu/drm/i915/intel_wakeref.c b/drivers/gpu/drm/i915/intel_wakeref.c
index 07e81be4d3920febece34709c63a63204a41583c..5269e64c58a49884f5d712557546272bfdeb8417 100644
--- a/drivers/gpu/drm/i915/intel_wakeref.c
+++ b/drivers/gpu/drm/i915/intel_wakeref.c
@@ -114,7 +114,7 @@ void __intel_wakeref_init(struct intel_wakeref *wf,
"wakeref.work", &key->work, 0);
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_WAKEREF)
- ref_tracker_dir_init(&wf->debug, INTEL_REFTRACK_DEAD_COUNT, name);
+ ref_tracker_dir_init(&wf->debug, INTEL_REFTRACK_DEAD_COUNT, "intel_wakeref", name);
#endif
}
diff --git a/include/linux/ref_tracker.h b/include/linux/ref_tracker.h
index 8eac4f3d52547ccbaf9dcd09962ce80d26fbdff8..2adae128d4b5e45f156af4775a1d184bb596fa91 100644
--- a/include/linux/ref_tracker.h
+++ b/include/linux/ref_tracker.h
@@ -17,6 +17,7 @@ struct ref_tracker_dir {
bool dead;
struct list_head list; /* List of active trackers */
struct list_head quarantine; /* List of dead trackers */
+ const char *class; /* object classname */
char name[32];
#endif
};
@@ -25,6 +26,7 @@ struct ref_tracker_dir {
static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
unsigned int quarantine_count,
+ const char *class,
const char *name)
{
INIT_LIST_HEAD(&dir->list);
@@ -34,6 +36,7 @@ static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
dir->dead = false;
refcount_set(&dir->untracked, 1);
refcount_set(&dir->no_tracker, 1);
+ dir->class = class;
strscpy(dir->name, name, sizeof(dir->name));
stack_depot_init();
}
@@ -58,6 +61,7 @@ int ref_tracker_free(struct ref_tracker_dir *dir,
static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
unsigned int quarantine_count,
+ const char *class,
const char *name)
{
}
diff --git a/lib/test_ref_tracker.c b/lib/test_ref_tracker.c
index b983ceb12afcb84ad60360a1e6fec0072e78ef79..d263502a4c1db248f64a66a468e96c8e4cffab25 100644
--- a/lib/test_ref_tracker.c
+++ b/lib/test_ref_tracker.c
@@ -64,7 +64,7 @@ static int __init test_ref_tracker_init(void)
{
int i;
- ref_tracker_dir_init(&ref_dir, 100, "selftest");
+ ref_tracker_dir_init(&ref_dir, 100, "selftest", "selftest");
timer_setup(&test_ref_tracker_timer, test_ref_tracker_timer_func, 0);
mod_timer(&test_ref_tracker_timer, jiffies + 1);
diff --git a/net/core/dev.c b/net/core/dev.c
index 1be7cb73a6024fda6797b6dfc895e4ce25f43251..380d07bec15a1f62ed27c31a6e211e74f3a5561d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -11620,7 +11620,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
dev->priv_len = sizeof_priv;
- ref_tracker_dir_init(&dev->refcnt_tracker, 128, name);
+ ref_tracker_dir_init(&dev->refcnt_tracker, 128, "netdev", name);
#ifdef CONFIG_PCPU_DEV_REFCNT
dev->pcpu_refcnt = alloc_percpu(int);
if (!dev->pcpu_refcnt)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index b0dfdf791ece5aa8fefdc2aea1ff4a9d9c399d72..008de9675ea98fa8c18628b2f1c3aee7f3ebc9c6 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -324,8 +324,8 @@ static __net_init void preinit_net(struct net *net, struct user_namespace *user_
{
refcount_set(&net->passive, 1);
refcount_set(&net->ns.count, 1);
- ref_tracker_dir_init(&net->refcnt_tracker, 128, "net refcnt");
- ref_tracker_dir_init(&net->notrefcnt_tracker, 128, "net notrefcnt");
+ ref_tracker_dir_init(&net->refcnt_tracker, 128, "net_refcnt", "net_refcnt");
+ ref_tracker_dir_init(&net->notrefcnt_tracker, 128, "net_notrefcnt", "net_notrefcnt");
get_random_bytes(&net->hash_mix, sizeof(u32));
net->dev_base_seq = 1;
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v6 05/10] ref_tracker: allow pr_ostream() to print directly to a seq_file
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
` (3 preceding siblings ...)
2025-04-30 15:06 ` [PATCH v6 04/10] ref_tracker: add a static classname string to each ref_tracker_dir Jeff Layton
@ 2025-04-30 15:06 ` Jeff Layton
2025-04-30 15:06 ` [PATCH v6 06/10] ref_tracker: automatically register a file in debugfs for a ref_tracker_dir Jeff Layton
` (4 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton
Allow pr_ostream to also output directly to a seq_file without an
intermediate buffer. The first caller of +ref_tracker_dir_seq_print()
will come in a later patch, so mark that __maybe_unused for now. That
designation will be removed once it is used.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
lib/ref_tracker.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c
index b6e0a87dd75eddef4d504419c0cf398ea65c19d8..b69c11e83c18c19aaa2dc23f802291d4a7e82a66 100644
--- a/lib/ref_tracker.c
+++ b/lib/ref_tracker.c
@@ -8,6 +8,7 @@
#include <linux/slab.h>
#include <linux/stacktrace.h>
#include <linux/stackdepot.h>
+#include <linux/seq_file.h>
#define REF_TRACKER_STACK_ENTRIES 16
#define STACK_BUF_SIZE 1024
@@ -70,6 +71,7 @@ struct ostream {
void __ostream_printf (*func)(struct ostream *stream, char *fmt, ...);
char *prefix;
char *buf;
+ struct seq_file *seq;
int size, used;
};
@@ -93,6 +95,15 @@ static void __ostream_printf pr_ostream_buf(struct ostream *stream, char *fmt, .
stream->used += min(ret, len);
}
+static void __ostream_printf pr_ostream_seq(struct ostream *stream, char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ seq_vprintf(stream->seq, fmt, args);
+ va_end(args);
+}
+
#define pr_ostream(stream, fmt, args...) \
({ \
struct ostream *_s = (stream); \
@@ -302,6 +313,21 @@ EXPORT_SYMBOL_GPL(ref_tracker_free);
#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
+static __maybe_unused int
+ref_tracker_dir_seq_print(struct ref_tracker_dir *dir, struct seq_file *seq)
+{
+ struct ostream os = { .func = pr_ostream_seq,
+ .prefix = "",
+ .seq = seq };
+ unsigned long flags;
+
+ spin_lock_irqsave(&dir->lock, flags);
+ __ref_tracker_dir_pr_ostream(dir, 16, &os);
+ spin_unlock_irqrestore(&dir->lock, flags);
+
+ return os.used;
+}
+
static int __init ref_tracker_debugfs_init(void)
{
ref_tracker_debug_dir = debugfs_create_dir("ref_tracker", NULL);
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v6 06/10] ref_tracker: automatically register a file in debugfs for a ref_tracker_dir
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
` (4 preceding siblings ...)
2025-04-30 15:06 ` [PATCH v6 05/10] ref_tracker: allow pr_ostream() to print directly to a seq_file Jeff Layton
@ 2025-04-30 15:06 ` Jeff Layton
2025-05-05 8:05 ` Jani Nikula
2025-04-30 15:06 ` [PATCH v6 07/10] ref_tracker: add a way to create a symlink to the ref_tracker_dir debugfs file Jeff Layton
` (3 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton
Currently, there is no convenient way to see the info that the
ref_tracking infrastructure collects. Attempt to create a file in
debugfs when called from ref_tracker_dir_init().
The file is given the name "class@%px", as having the unmodified address
is helpful for debugging. This should be safe since this directory is only
accessible by root
If debugfs file creation fails, a pr_warn will be isssued.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
include/linux/ref_tracker.h | 14 +++++++++
lib/ref_tracker.c | 73 +++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 85 insertions(+), 2 deletions(-)
diff --git a/include/linux/ref_tracker.h b/include/linux/ref_tracker.h
index 2adae128d4b5e45f156af4775a1d184bb596fa91..c6e65d7ef4d4fc74c60fcabd19166c131d4173e2 100644
--- a/include/linux/ref_tracker.h
+++ b/include/linux/ref_tracker.h
@@ -5,6 +5,7 @@
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/stackdepot.h>
+#include <linux/seq_file.h>
struct ref_tracker;
@@ -18,12 +19,17 @@ struct ref_tracker_dir {
struct list_head list; /* List of active trackers */
struct list_head quarantine; /* List of dead trackers */
const char *class; /* object classname */
+#ifdef CONFIG_DEBUG_FS
+ struct dentry *dentry;
+#endif
char name[32];
#endif
};
#ifdef CONFIG_REF_TRACKER
+void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir);
+
static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
unsigned int quarantine_count,
const char *class,
@@ -37,7 +43,11 @@ static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
refcount_set(&dir->untracked, 1);
refcount_set(&dir->no_tracker, 1);
dir->class = class;
+#ifdef CONFIG_DEBUG_FS
+ dir->dentry = NULL;
+#endif
strscpy(dir->name, name, sizeof(dir->name));
+ ref_tracker_dir_debugfs(dir);
stack_depot_init();
}
@@ -66,6 +76,10 @@ static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
{
}
+static inline void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir)
+{
+}
+
static inline void ref_tracker_dir_exit(struct ref_tracker_dir *dir)
{
}
diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c
index b69c11e83c18c19aaa2dc23f802291d4a7e82a66..3ee4fd0f33407881cfa140dcb7d8b40e3c2722de 100644
--- a/lib/ref_tracker.c
+++ b/lib/ref_tracker.c
@@ -31,6 +31,14 @@ struct ref_tracker_dir_stats {
} stacks[];
};
+#ifdef CONFIG_DEBUG_FS
+static void ref_tracker_debugfs_remove(struct ref_tracker_dir *dir);
+#else
+static inline void ref_tracker_debugfs_remove(struct ref_tracker_dir *dir)
+{
+}
+#endif
+
static struct ref_tracker_dir_stats *
ref_tracker_get_stats(struct ref_tracker_dir *dir, unsigned int limit)
{
@@ -197,6 +205,7 @@ void ref_tracker_dir_exit(struct ref_tracker_dir *dir)
bool leak = false;
dir->dead = true;
+ ref_tracker_debugfs_remove(dir);
spin_lock_irqsave(&dir->lock, flags);
list_for_each_entry_safe(tracker, n, &dir->quarantine, head) {
list_del(&tracker->head);
@@ -313,8 +322,7 @@ EXPORT_SYMBOL_GPL(ref_tracker_free);
#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
-static __maybe_unused int
-ref_tracker_dir_seq_print(struct ref_tracker_dir *dir, struct seq_file *seq)
+static int ref_tracker_dir_seq_print(struct ref_tracker_dir *dir, struct seq_file *seq)
{
struct ostream os = { .func = pr_ostream_seq,
.prefix = "",
@@ -328,6 +336,67 @@ ref_tracker_dir_seq_print(struct ref_tracker_dir *dir, struct seq_file *seq)
return os.used;
}
+static int ref_tracker_debugfs_show(struct seq_file *f, void *v)
+{
+ struct ref_tracker_dir *dir = f->private;
+
+ return ref_tracker_dir_seq_print(dir, f);
+}
+
+static int ref_tracker_debugfs_open(struct inode *inode, struct file *filp)
+{
+ struct ref_tracker_dir *dir = inode->i_private;
+
+ return single_open(filp, ref_tracker_debugfs_show, dir);
+}
+
+static const struct file_operations ref_tracker_debugfs_fops = {
+ .owner = THIS_MODULE,
+ .open = ref_tracker_debugfs_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
+
+/**
+ * ref_tracker_dir_debugfs - create debugfs file for ref_tracker_dir
+ * @dir: ref_tracker_dir to be associated with debugfs file
+ *
+ * In most cases, a debugfs file will be created automatically for every
+ * ref_tracker_dir. If the object was created before debugfs is brought up
+ * then that may fail. In those cases, it is safe to call this at a later
+ * time to create the file.
+ */
+void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir)
+{
+ char name[NAME_MAX + 1];
+ int ret;
+
+ /* No-op if already created */
+ if (!IS_ERR_OR_NULL(dir->dentry))
+ return;
+
+ ret = snprintf(name, sizeof(name), "%s@%px", dir->class, dir);
+ name[sizeof(name) - 1] = '\0';
+
+ if (ret < sizeof(name))
+ dir->dentry = debugfs_create_file(name, S_IFREG | 0400,
+ ref_tracker_debug_dir, dir,
+ &ref_tracker_debugfs_fops);
+ else
+ dir->dentry = ERR_PTR(-ENAMETOOLONG);
+
+ if (IS_ERR(dir->dentry))
+ pr_warn("ref_tracker: unable to create debugfs file for %s: %pe\n",
+ name, dir->dentry);
+}
+EXPORT_SYMBOL(ref_tracker_dir_debugfs);
+
+static void ref_tracker_debugfs_remove(struct ref_tracker_dir *dir)
+{
+ debugfs_remove(dir->dentry);
+}
+
static int __init ref_tracker_debugfs_init(void)
{
ref_tracker_debug_dir = debugfs_create_dir("ref_tracker", NULL);
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v6 07/10] ref_tracker: add a way to create a symlink to the ref_tracker_dir debugfs file
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
` (5 preceding siblings ...)
2025-04-30 15:06 ` [PATCH v6 06/10] ref_tracker: automatically register a file in debugfs for a ref_tracker_dir Jeff Layton
@ 2025-04-30 15:06 ` Jeff Layton
2025-04-30 15:06 ` [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns Jeff Layton
` (2 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton
Add the ability for a subsystem to add a user-friendly symlink that
points to a ref_tracker_dir's debugfs file.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
include/linux/ref_tracker.h | 10 ++++++++++
lib/ref_tracker.c | 28 ++++++++++++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/include/linux/ref_tracker.h b/include/linux/ref_tracker.h
index c6e65d7ef4d4fc74c60fcabd19166c131d4173e2..210f26e2528f23bea3b713a57ac27c730bd100ce 100644
--- a/include/linux/ref_tracker.h
+++ b/include/linux/ref_tracker.h
@@ -21,6 +21,7 @@ struct ref_tracker_dir {
const char *class; /* object classname */
#ifdef CONFIG_DEBUG_FS
struct dentry *dentry;
+ struct dentry *symlink;
#endif
char name[32];
#endif
@@ -29,6 +30,7 @@ struct ref_tracker_dir {
#ifdef CONFIG_REF_TRACKER
void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir);
+void ref_tracker_dir_symlink(struct ref_tracker_dir *dir, const char *fmt, ...);
static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
unsigned int quarantine_count,
@@ -45,6 +47,7 @@ static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
dir->class = class;
#ifdef CONFIG_DEBUG_FS
dir->dentry = NULL;
+ dir->symlink = NULL;
#endif
strscpy(dir->name, name, sizeof(dir->name));
ref_tracker_dir_debugfs(dir);
@@ -80,6 +83,10 @@ static inline void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir)
{
}
+static inline void ref_tracker_dir_symlink(struct ref_tracker_dir *dir, const char *fmt, ...)
+{
+}
+
static inline void ref_tracker_dir_exit(struct ref_tracker_dir *dir)
{
}
@@ -113,6 +120,9 @@ static inline int ref_tracker_free(struct ref_tracker_dir *dir,
return 0;
}
+static inline void ref_tracker_dir_symlink(struct ref_tracker_dir *dir, const char *fmt, ...)
+{
+}
#endif
#endif /* _LINUX_REF_TRACKER_H */
diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c
index 3ee4fd0f33407881cfa140dcb7d8b40e3c2722de..16ef752e52c230763f2832c312793d27da47c608 100644
--- a/lib/ref_tracker.c
+++ b/lib/ref_tracker.c
@@ -392,8 +392,36 @@ void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir)
}
EXPORT_SYMBOL(ref_tracker_dir_debugfs);
+void __ostream_printf ref_tracker_dir_symlink(struct ref_tracker_dir *dir, const char *fmt, ...)
+{
+ char name[NAME_MAX + 1];
+ va_list args;
+ int ret;
+
+ /* Already created, or dentry doesn't exist? Do nothing */
+ if (!IS_ERR_OR_NULL(dir->symlink) || IS_ERR_OR_NULL(dir->dentry))
+ return;
+
+ va_start(args, fmt);
+ ret = vsnprintf(name, sizeof(name), fmt, args);
+ va_end(args);
+ name[sizeof(name) - 1] = '\0';
+
+ if (ret < sizeof(name))
+ dir->symlink = debugfs_create_symlink(name, ref_tracker_debug_dir,
+ dir->dentry->d_name.name);
+ else
+ dir->symlink = ERR_PTR(-ENAMETOOLONG);
+
+ if (IS_ERR(dir->symlink))
+ pr_warn("ref_tracker: unable to create debugfs symlink for %s: %pe\n",
+ name, dir->symlink);
+}
+EXPORT_SYMBOL(ref_tracker_dir_symlink);
+
static void ref_tracker_debugfs_remove(struct ref_tracker_dir *dir)
{
+ debugfs_remove(dir->symlink);
debugfs_remove(dir->dentry);
}
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
` (6 preceding siblings ...)
2025-04-30 15:06 ` [PATCH v6 07/10] ref_tracker: add a way to create a symlink to the ref_tracker_dir debugfs file Jeff Layton
@ 2025-04-30 15:06 ` Jeff Layton
2025-04-30 21:29 ` Kuniyuki Iwashima
2025-04-30 15:06 ` [PATCH v6 09/10] i915: add ref_tracker_dir symlinks for each tracker Jeff Layton
2025-04-30 15:06 ` [PATCH v6 10/10] ref_tracker: eliminate the ref_tracker_dir name field Jeff Layton
9 siblings, 1 reply; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton
After assigning the inode number to the namespace, use it to create a
unique name for each netns refcount tracker with the ns.inum value in
it, and register a symlink to the debugfs file for it.
init_net is registered before the ref_tracker dir is created, so add a
late_initcall() to register its files and symlinks.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
net/core/net_namespace.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 008de9675ea98fa8c18628b2f1c3aee7f3ebc9c6..6cbc8eabb8e56c847fc34fa8ec9994e8b275b0af 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -763,12 +763,38 @@ struct net *get_net_ns_by_pid(pid_t pid)
}
EXPORT_SYMBOL_GPL(get_net_ns_by_pid);
+#ifdef CONFIG_NET_NS_REFCNT_TRACKER
+static void net_ns_net_debugfs(struct net *net)
+{
+ ref_tracker_dir_symlink(&net->refcnt_tracker, "netns-%u-refcnt", net->ns.inum);
+ ref_tracker_dir_symlink(&net->notrefcnt_tracker, "netns-%u-notrefcnt", net->ns.inum);
+}
+
+static int __init init_net_debugfs(void)
+{
+ ref_tracker_dir_debugfs(&init_net.refcnt_tracker);
+ ref_tracker_dir_debugfs(&init_net.notrefcnt_tracker);
+ net_ns_net_debugfs(&init_net);
+ return 0;
+}
+late_initcall(init_net_debugfs);
+#else
+static void net_ns_net_debugfs(struct net *net)
+{
+}
+#endif
+
static __net_init int net_ns_net_init(struct net *net)
{
+ int ret;
+
#ifdef CONFIG_NET_NS
net->ns.ops = &netns_operations;
#endif
- return ns_alloc_inum(&net->ns);
+ ret = ns_alloc_inum(&net->ns);
+ if (!ret)
+ net_ns_net_debugfs(net);
+ return ret;
}
static __net_exit void net_ns_net_exit(struct net *net)
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v6 09/10] i915: add ref_tracker_dir symlinks for each tracker
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
` (7 preceding siblings ...)
2025-04-30 15:06 ` [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns Jeff Layton
@ 2025-04-30 15:06 ` Jeff Layton
2025-04-30 15:06 ` [PATCH v6 10/10] ref_tracker: eliminate the ref_tracker_dir name field Jeff Layton
9 siblings, 0 replies; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton
Now that there is the ability to create a symlink for each tracker, do
so for the i915 entries.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
drivers/gpu/drm/i915/intel_runtime_pm.c | 1 +
drivers/gpu/drm/i915/intel_wakeref.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 3fdab3b44c08cea16ac2f73aafc2bea2ffbb19e7..94315e952ead9be276298fb2a0200d102005a0c1 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -61,6 +61,7 @@ static void init_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm)
{
ref_tracker_dir_init(&rpm->debug, INTEL_REFTRACK_DEAD_COUNT,
"intel_runtime_pm", dev_name(rpm->kdev));
+ ref_tracker_dir_symlink(&rpm->debug, "intel_runtime_pm-%s", dev_name(rpm->kdev));
}
static intel_wakeref_t
diff --git a/drivers/gpu/drm/i915/intel_wakeref.c b/drivers/gpu/drm/i915/intel_wakeref.c
index 5269e64c58a49884f5d712557546272bfdeb8417..2e0498b3fa7947f994de1339d4d2bed93de1a795 100644
--- a/drivers/gpu/drm/i915/intel_wakeref.c
+++ b/drivers/gpu/drm/i915/intel_wakeref.c
@@ -115,6 +115,7 @@ void __intel_wakeref_init(struct intel_wakeref *wf,
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_WAKEREF)
ref_tracker_dir_init(&wf->debug, INTEL_REFTRACK_DEAD_COUNT, "intel_wakeref", name);
+ ref_tracker_dir_symlink(&wf->debug, "intel_wakeref-%s", name);
#endif
}
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v6 10/10] ref_tracker: eliminate the ref_tracker_dir name field
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
` (8 preceding siblings ...)
2025-04-30 15:06 ` [PATCH v6 09/10] i915: add ref_tracker_dir symlinks for each tracker Jeff Layton
@ 2025-04-30 15:06 ` Jeff Layton
9 siblings, 0 replies; 19+ messages in thread
From: Jeff Layton @ 2025-04-30 15:06 UTC (permalink / raw)
To: Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton
Now that we have dentries and the ability to create meaningful symlinks
to them, don't keep a name string in each tracker. Switch the output
format to print "class@address", and drop the name field.
Also, add a kerneldoc header for ref_tracker_dir_init().
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
drivers/gpu/drm/display/drm_dp_tunnel.c | 2 +-
drivers/gpu/drm/i915/intel_runtime_pm.c | 2 +-
drivers/gpu/drm/i915/intel_wakeref.c | 2 +-
include/linux/ref_tracker.h | 20 ++++++++++++++------
lib/ref_tracker.c | 6 +++---
lib/test_ref_tracker.c | 2 +-
net/core/dev.c | 2 +-
net/core/net_namespace.c | 4 ++--
8 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_dp_tunnel.c b/drivers/gpu/drm/display/drm_dp_tunnel.c
index f2a8ef6abf34d89a642d7c7708c41e5b1dc9dece..f8d1f9c60e86c5a7b1866e1c9f6425e99d4ca9c6 100644
--- a/drivers/gpu/drm/display/drm_dp_tunnel.c
+++ b/drivers/gpu/drm/display/drm_dp_tunnel.c
@@ -1920,7 +1920,7 @@ drm_dp_tunnel_mgr_create(struct drm_device *dev, int max_group_count)
}
#ifdef CONFIG_DRM_DISPLAY_DP_TUNNEL_STATE_DEBUG
- ref_tracker_dir_init(&mgr->ref_tracker, 16, "drm_dptun", "dptun");
+ ref_tracker_dir_init(&mgr->ref_tracker, 16, "drm_dptun");
#endif
for (i = 0; i < max_group_count; i++) {
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 94315e952ead9be276298fb2a0200d102005a0c1..d560f94af7a86f1fc139204a4e901eaea22c6ef1 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -60,7 +60,7 @@ static struct drm_i915_private *rpm_to_i915(struct intel_runtime_pm *rpm)
static void init_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm)
{
ref_tracker_dir_init(&rpm->debug, INTEL_REFTRACK_DEAD_COUNT,
- "intel_runtime_pm", dev_name(rpm->kdev));
+ "intel_runtime_pm");
ref_tracker_dir_symlink(&rpm->debug, "intel_runtime_pm-%s", dev_name(rpm->kdev));
}
diff --git a/drivers/gpu/drm/i915/intel_wakeref.c b/drivers/gpu/drm/i915/intel_wakeref.c
index 2e0498b3fa7947f994de1339d4d2bed93de1a795..bbd5171ce0a22435e540f10821f2a0dad59c1d2f 100644
--- a/drivers/gpu/drm/i915/intel_wakeref.c
+++ b/drivers/gpu/drm/i915/intel_wakeref.c
@@ -114,7 +114,7 @@ void __intel_wakeref_init(struct intel_wakeref *wf,
"wakeref.work", &key->work, 0);
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_WAKEREF)
- ref_tracker_dir_init(&wf->debug, INTEL_REFTRACK_DEAD_COUNT, "intel_wakeref", name);
+ ref_tracker_dir_init(&wf->debug, INTEL_REFTRACK_DEAD_COUNT, "intel_wakeref");
ref_tracker_dir_symlink(&wf->debug, "intel_wakeref-%s", name);
#endif
}
diff --git a/include/linux/ref_tracker.h b/include/linux/ref_tracker.h
index 210f26e2528f23bea3b713a57ac27c730bd100ce..262432d6cbf265ea76bad968a7b00485586dfd60 100644
--- a/include/linux/ref_tracker.h
+++ b/include/linux/ref_tracker.h
@@ -23,7 +23,6 @@ struct ref_tracker_dir {
struct dentry *dentry;
struct dentry *symlink;
#endif
- char name[32];
#endif
};
@@ -32,10 +31,21 @@ struct ref_tracker_dir {
void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir);
void ref_tracker_dir_symlink(struct ref_tracker_dir *dir, const char *fmt, ...);
+/**
+ * ref_tracker_dir_init - initialize a ref_tracker dir
+ * @dir: ref_tracker_dir to be initialized
+ * @quarantime_count: max number of entries to be tracked
+ * @class: pointer to static string that describes object type
+ *
+ * Initialize a ref_tracker_dir. If debugfs is configured, then a file
+ * will also be created for it under the top-level ref_tracker debugfs
+ * directory.
+ *
+ * Note that @class must point to a static string.
+ */
static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
unsigned int quarantine_count,
- const char *class,
- const char *name)
+ const char *class)
{
INIT_LIST_HEAD(&dir->list);
INIT_LIST_HEAD(&dir->quarantine);
@@ -49,7 +59,6 @@ static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
dir->dentry = NULL;
dir->symlink = NULL;
#endif
- strscpy(dir->name, name, sizeof(dir->name));
ref_tracker_dir_debugfs(dir);
stack_depot_init();
}
@@ -74,8 +83,7 @@ int ref_tracker_free(struct ref_tracker_dir *dir,
static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
unsigned int quarantine_count,
- const char *class,
- const char *name)
+ const char *class)
{
}
diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c
index 16ef752e52c230763f2832c312793d27da47c608..2ec34846aaa354b3e4057e51ec44433fcec9af86 100644
--- a/lib/ref_tracker.c
+++ b/lib/ref_tracker.c
@@ -136,7 +136,7 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir,
stats = ref_tracker_get_stats(dir, display_limit);
if (IS_ERR(stats)) {
pr_ostream(s, "%s%s@%p: couldn't get stats, error %pe\n",
- s->prefix, dir->name, dir, stats);
+ s->prefix, dir->class, dir, stats);
return;
}
@@ -147,14 +147,14 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir,
if (sbuf && !stack_depot_snprint(stack, sbuf, STACK_BUF_SIZE, 4))
sbuf[0] = 0;
pr_ostream(s, "%s%s@%p has %d/%d users at\n%s\n", s->prefix,
- dir->name, dir, stats->stacks[i].count,
+ dir->class, dir, stats->stacks[i].count,
stats->total, sbuf);
skipped -= stats->stacks[i].count;
}
if (skipped)
pr_ostream(s, "%s%s@%p skipped reports about %d/%d users.\n",
- s->prefix, dir->name, dir, skipped, stats->total);
+ s->prefix, dir->class, dir, skipped, stats->total);
kfree(sbuf);
diff --git a/lib/test_ref_tracker.c b/lib/test_ref_tracker.c
index d263502a4c1db248f64a66a468e96c8e4cffab25..b983ceb12afcb84ad60360a1e6fec0072e78ef79 100644
--- a/lib/test_ref_tracker.c
+++ b/lib/test_ref_tracker.c
@@ -64,7 +64,7 @@ static int __init test_ref_tracker_init(void)
{
int i;
- ref_tracker_dir_init(&ref_dir, 100, "selftest", "selftest");
+ ref_tracker_dir_init(&ref_dir, 100, "selftest");
timer_setup(&test_ref_tracker_timer, test_ref_tracker_timer_func, 0);
mod_timer(&test_ref_tracker_timer, jiffies + 1);
diff --git a/net/core/dev.c b/net/core/dev.c
index 380d07bec15a1f62ed27c31a6e211e74f3a5561d..00776cba0276554066c94a6fc86f5ed4df430cfa 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -11620,7 +11620,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
dev->priv_len = sizeof_priv;
- ref_tracker_dir_init(&dev->refcnt_tracker, 128, "netdev", name);
+ ref_tracker_dir_init(&dev->refcnt_tracker, 128, "netdev");
#ifdef CONFIG_PCPU_DEV_REFCNT
dev->pcpu_refcnt = alloc_percpu(int);
if (!dev->pcpu_refcnt)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 6cbc8eabb8e56c847fc34fa8ec9994e8b275b0af..d70e058476aafbac59738e1fd88f0ebb32ee0fb2 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -324,8 +324,8 @@ static __net_init void preinit_net(struct net *net, struct user_namespace *user_
{
refcount_set(&net->passive, 1);
refcount_set(&net->ns.count, 1);
- ref_tracker_dir_init(&net->refcnt_tracker, 128, "net_refcnt", "net_refcnt");
- ref_tracker_dir_init(&net->notrefcnt_tracker, 128, "net_notrefcnt", "net_notrefcnt");
+ ref_tracker_dir_init(&net->refcnt_tracker, 128, "net_refcnt");
+ ref_tracker_dir_init(&net->notrefcnt_tracker, 128, "net_notrefcnt");
get_random_bytes(&net->hash_mix, sizeof(u32));
net->dev_base_seq = 1;
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns
2025-04-30 15:06 ` [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns Jeff Layton
@ 2025-04-30 21:29 ` Kuniyuki Iwashima
2025-05-01 2:59 ` Jeff Layton
0 siblings, 1 reply; 19+ messages in thread
From: Kuniyuki Iwashima @ 2025-04-30 21:29 UTC (permalink / raw)
To: jlayton
Cc: airlied, akpm, andrew, davem, dri-devel, edumazet, horms,
intel-gfx, jani.nikula, joonas.lahtinen, kuba, kuniyu,
linux-kernel, maarten.lankhorst, mripard, nathan, netdev, pabeni,
qasdev00, rodrigo.vivi, simona, tursulin, tzimmermann
From: Jeff Layton <jlayton@kernel.org>
Date: Wed, 30 Apr 2025 08:06:54 -0700
> After assigning the inode number to the namespace, use it to create a
> unique name for each netns refcount tracker with the ns.inum value in
> it, and register a symlink to the debugfs file for it.
>
> init_net is registered before the ref_tracker dir is created, so add a
> late_initcall() to register its files and symlinks.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> net/core/net_namespace.c | 28 +++++++++++++++++++++++++++-
> 1 file changed, 27 insertions(+), 1 deletion(-)
>
> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> index 008de9675ea98fa8c18628b2f1c3aee7f3ebc9c6..6cbc8eabb8e56c847fc34fa8ec9994e8b275b0af 100644
> --- a/net/core/net_namespace.c
> +++ b/net/core/net_namespace.c
> @@ -763,12 +763,38 @@ struct net *get_net_ns_by_pid(pid_t pid)
> }
> EXPORT_SYMBOL_GPL(get_net_ns_by_pid);
>
> +#ifdef CONFIG_NET_NS_REFCNT_TRACKER
> +static void net_ns_net_debugfs(struct net *net)
> +{
> + ref_tracker_dir_symlink(&net->refcnt_tracker, "netns-%u-refcnt", net->ns.inum);
> + ref_tracker_dir_symlink(&net->notrefcnt_tracker, "netns-%u-notrefcnt", net->ns.inum);
Could you use net->net_cookie ?
net->ns.inum is always 1 when CONFIG_PROC_FS=n.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns
2025-04-30 21:29 ` Kuniyuki Iwashima
@ 2025-05-01 2:59 ` Jeff Layton
2025-05-01 3:07 ` Kuniyuki Iwashima
0 siblings, 1 reply; 19+ messages in thread
From: Jeff Layton @ 2025-05-01 2:59 UTC (permalink / raw)
To: Kuniyuki Iwashima
Cc: airlied, akpm, andrew, davem, dri-devel, edumazet, horms,
intel-gfx, jani.nikula, joonas.lahtinen, kuba, linux-kernel,
maarten.lankhorst, mripard, nathan, netdev, pabeni, qasdev00,
rodrigo.vivi, simona, tursulin, tzimmermann
On Wed, 2025-04-30 at 14:29 -0700, Kuniyuki Iwashima wrote:
> From: Jeff Layton <jlayton@kernel.org>
> Date: Wed, 30 Apr 2025 08:06:54 -0700
> > After assigning the inode number to the namespace, use it to create a
> > unique name for each netns refcount tracker with the ns.inum value in
> > it, and register a symlink to the debugfs file for it.
> >
> > init_net is registered before the ref_tracker dir is created, so add a
> > late_initcall() to register its files and symlinks.
> >
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> > net/core/net_namespace.c | 28 +++++++++++++++++++++++++++-
> > 1 file changed, 27 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> > index 008de9675ea98fa8c18628b2f1c3aee7f3ebc9c6..6cbc8eabb8e56c847fc34fa8ec9994e8b275b0af 100644
> > --- a/net/core/net_namespace.c
> > +++ b/net/core/net_namespace.c
> > @@ -763,12 +763,38 @@ struct net *get_net_ns_by_pid(pid_t pid)
> > }
> > EXPORT_SYMBOL_GPL(get_net_ns_by_pid);
> >
> > +#ifdef CONFIG_NET_NS_REFCNT_TRACKER
> > +static void net_ns_net_debugfs(struct net *net)
> > +{
> > + ref_tracker_dir_symlink(&net->refcnt_tracker, "netns-%u-refcnt", net->ns.inum);
> > + ref_tracker_dir_symlink(&net->notrefcnt_tracker, "netns-%u-notrefcnt", net->ns.inum);
>
> Could you use net->net_cookie ?
>
> net->ns.inum is always 1 when CONFIG_PROC_FS=n.
My main use-case for this is to be able to match the inode number in
the /proc/<pid>/ns/net symlink with the correct ref_tracker debugfs
file. Is there a way to use the net_cookie to make that association?
If there isn't, and ns.inum is always 1 with procfs is disabled, we
could just skip adding the symlink when CONFIG_PROC_FS=n.
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns
2025-05-01 2:59 ` Jeff Layton
@ 2025-05-01 3:07 ` Kuniyuki Iwashima
2025-05-01 3:42 ` Jeff Layton
0 siblings, 1 reply; 19+ messages in thread
From: Kuniyuki Iwashima @ 2025-05-01 3:07 UTC (permalink / raw)
To: jlayton
Cc: airlied, akpm, andrew, davem, dri-devel, edumazet, horms,
intel-gfx, jani.nikula, joonas.lahtinen, kuba, kuniyu,
linux-kernel, maarten.lankhorst, mripard, nathan, netdev, pabeni,
qasdev00, rodrigo.vivi, simona, tursulin, tzimmermann
From: Jeff Layton <jlayton@kernel.org>
Date: Wed, 30 Apr 2025 19:59:23 -0700
> On Wed, 2025-04-30 at 14:29 -0700, Kuniyuki Iwashima wrote:
> > From: Jeff Layton <jlayton@kernel.org>
> > Date: Wed, 30 Apr 2025 08:06:54 -0700
> > > After assigning the inode number to the namespace, use it to create a
> > > unique name for each netns refcount tracker with the ns.inum value in
> > > it, and register a symlink to the debugfs file for it.
> > >
> > > init_net is registered before the ref_tracker dir is created, so add a
> > > late_initcall() to register its files and symlinks.
> > >
> > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > > ---
> > > net/core/net_namespace.c | 28 +++++++++++++++++++++++++++-
> > > 1 file changed, 27 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> > > index 008de9675ea98fa8c18628b2f1c3aee7f3ebc9c6..6cbc8eabb8e56c847fc34fa8ec9994e8b275b0af 100644
> > > --- a/net/core/net_namespace.c
> > > +++ b/net/core/net_namespace.c
> > > @@ -763,12 +763,38 @@ struct net *get_net_ns_by_pid(pid_t pid)
> > > }
> > > EXPORT_SYMBOL_GPL(get_net_ns_by_pid);
> > >
> > > +#ifdef CONFIG_NET_NS_REFCNT_TRACKER
> > > +static void net_ns_net_debugfs(struct net *net)
> > > +{
> > > + ref_tracker_dir_symlink(&net->refcnt_tracker, "netns-%u-refcnt", net->ns.inum);
> > > + ref_tracker_dir_symlink(&net->notrefcnt_tracker, "netns-%u-notrefcnt", net->ns.inum);
> >
> > Could you use net->net_cookie ?
> >
> > net->ns.inum is always 1 when CONFIG_PROC_FS=n.
>
> My main use-case for this is to be able to match the inode number in
> the /proc/<pid>/ns/net symlink with the correct ref_tracker debugfs
> file. Is there a way to use the net_cookie to make that association?
It's roundabout, but net_cookie can be retrieved by creating a
random socket in the netns and calling setsockopt(SO_NETNS_COOKIE).
Ido proposed a handy ip-netns subcommand here, and I guess it will
be implemented soon(?)
https://lore.kernel.org/netdev/1d99d7ccfc3a7a18840948ab6ba1c0b5fad90901.camel@fejes.dev/
>
> If there isn't, and ns.inum is always 1 with procfs is disabled, we
> could just skip adding the symlink when CONFIG_PROC_FS=n.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns
2025-05-01 3:07 ` Kuniyuki Iwashima
@ 2025-05-01 3:42 ` Jeff Layton
2025-05-01 3:50 ` Kuniyuki Iwashima
0 siblings, 1 reply; 19+ messages in thread
From: Jeff Layton @ 2025-05-01 3:42 UTC (permalink / raw)
To: Kuniyuki Iwashima
Cc: airlied, akpm, andrew, davem, dri-devel, edumazet, horms,
intel-gfx, jani.nikula, joonas.lahtinen, kuba, linux-kernel,
maarten.lankhorst, mripard, nathan, netdev, pabeni, qasdev00,
rodrigo.vivi, simona, tursulin, tzimmermann
On Wed, 2025-04-30 at 20:07 -0700, Kuniyuki Iwashima wrote:
> From: Jeff Layton <jlayton@kernel.org>
> Date: Wed, 30 Apr 2025 19:59:23 -0700
> > On Wed, 2025-04-30 at 14:29 -0700, Kuniyuki Iwashima wrote:
> > > From: Jeff Layton <jlayton@kernel.org>
> > > Date: Wed, 30 Apr 2025 08:06:54 -0700
> > > > After assigning the inode number to the namespace, use it to create a
> > > > unique name for each netns refcount tracker with the ns.inum value in
> > > > it, and register a symlink to the debugfs file for it.
> > > >
> > > > init_net is registered before the ref_tracker dir is created, so add a
> > > > late_initcall() to register its files and symlinks.
> > > >
> > > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > > > ---
> > > > net/core/net_namespace.c | 28 +++++++++++++++++++++++++++-
> > > > 1 file changed, 27 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> > > > index 008de9675ea98fa8c18628b2f1c3aee7f3ebc9c6..6cbc8eabb8e56c847fc34fa8ec9994e8b275b0af 100644
> > > > --- a/net/core/net_namespace.c
> > > > +++ b/net/core/net_namespace.c
> > > > @@ -763,12 +763,38 @@ struct net *get_net_ns_by_pid(pid_t pid)
> > > > }
> > > > EXPORT_SYMBOL_GPL(get_net_ns_by_pid);
> > > >
> > > > +#ifdef CONFIG_NET_NS_REFCNT_TRACKER
> > > > +static void net_ns_net_debugfs(struct net *net)
> > > > +{
> > > > + ref_tracker_dir_symlink(&net->refcnt_tracker, "netns-%u-refcnt", net->ns.inum);
> > > > + ref_tracker_dir_symlink(&net->notrefcnt_tracker, "netns-%u-notrefcnt", net->ns.inum);
> > >
> > > Could you use net->net_cookie ?
> > >
> > > net->ns.inum is always 1 when CONFIG_PROC_FS=n.
> >
> > My main use-case for this is to be able to match the inode number in
> > the /proc/<pid>/ns/net symlink with the correct ref_tracker debugfs
> > file. Is there a way to use the net_cookie to make that association?
>
> It's roundabout, but net_cookie can be retrieved by creating a
> random socket in the netns and calling setsockopt(SO_NETNS_COOKIE).
>
> Ido proposed a handy ip-netns subcommand here, and I guess it will
> be implemented soon(?)
> https://lore.kernel.org/netdev/1d99d7ccfc3a7a18840948ab6ba1c0b5fad90901.camel@fejes.dev/
For the cases where I was looking at netns leaks, there were no more
processes in the container, so there was no way to enter the container
and spawn a socket at that point.
The point of the symlinks is to have a way to easily identify what
you're tracking. NAME_MAX is 255. We could do something like this
instead:
snprintf(..., "netns-%u-%llx-refcnt", net->ns.inum, net->net_cookie);
Obviously the inums would all be 1 when PROC_FS=n, but the cookies
would be unique. Would that work?
>
> >
> > If there isn't, and ns.inum is always 1 with procfs is disabled, we
> > could just skip adding the symlink when CONFIG_PROC_FS=n.
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns
2025-05-01 3:42 ` Jeff Layton
@ 2025-05-01 3:50 ` Kuniyuki Iwashima
2025-05-01 4:07 ` Jeff Layton
0 siblings, 1 reply; 19+ messages in thread
From: Kuniyuki Iwashima @ 2025-05-01 3:50 UTC (permalink / raw)
To: jlayton
Cc: airlied, akpm, andrew, davem, dri-devel, edumazet, horms,
intel-gfx, jani.nikula, joonas.lahtinen, kuba, kuniyu,
linux-kernel, maarten.lankhorst, mripard, nathan, netdev, pabeni,
qasdev00, rodrigo.vivi, simona, tursulin, tzimmermann
From: Jeff Layton <jlayton@kernel.org>
Date: Wed, 30 Apr 2025 20:42:40 -0700
> On Wed, 2025-04-30 at 20:07 -0700, Kuniyuki Iwashima wrote:
> > From: Jeff Layton <jlayton@kernel.org>
> > Date: Wed, 30 Apr 2025 19:59:23 -0700
> > > On Wed, 2025-04-30 at 14:29 -0700, Kuniyuki Iwashima wrote:
> > > > From: Jeff Layton <jlayton@kernel.org>
> > > > Date: Wed, 30 Apr 2025 08:06:54 -0700
> > > > > After assigning the inode number to the namespace, use it to create a
> > > > > unique name for each netns refcount tracker with the ns.inum value in
> > > > > it, and register a symlink to the debugfs file for it.
> > > > >
> > > > > init_net is registered before the ref_tracker dir is created, so add a
> > > > > late_initcall() to register its files and symlinks.
> > > > >
> > > > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > > > > ---
> > > > > net/core/net_namespace.c | 28 +++++++++++++++++++++++++++-
> > > > > 1 file changed, 27 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> > > > > index 008de9675ea98fa8c18628b2f1c3aee7f3ebc9c6..6cbc8eabb8e56c847fc34fa8ec9994e8b275b0af 100644
> > > > > --- a/net/core/net_namespace.c
> > > > > +++ b/net/core/net_namespace.c
> > > > > @@ -763,12 +763,38 @@ struct net *get_net_ns_by_pid(pid_t pid)
> > > > > }
> > > > > EXPORT_SYMBOL_GPL(get_net_ns_by_pid);
> > > > >
> > > > > +#ifdef CONFIG_NET_NS_REFCNT_TRACKER
> > > > > +static void net_ns_net_debugfs(struct net *net)
> > > > > +{
> > > > > + ref_tracker_dir_symlink(&net->refcnt_tracker, "netns-%u-refcnt", net->ns.inum);
> > > > > + ref_tracker_dir_symlink(&net->notrefcnt_tracker, "netns-%u-notrefcnt", net->ns.inum);
> > > >
> > > > Could you use net->net_cookie ?
> > > >
> > > > net->ns.inum is always 1 when CONFIG_PROC_FS=n.
> > >
> > > My main use-case for this is to be able to match the inode number in
> > > the /proc/<pid>/ns/net symlink with the correct ref_tracker debugfs
> > > file. Is there a way to use the net_cookie to make that association?
> >
> > It's roundabout, but net_cookie can be retrieved by creating a
> > random socket in the netns and calling setsockopt(SO_NETNS_COOKIE).
> >
> > Ido proposed a handy ip-netns subcommand here, and I guess it will
> > be implemented soon(?)
> > https://lore.kernel.org/netdev/1d99d7ccfc3a7a18840948ab6ba1c0b5fad90901.camel@fejes.dev/
>
> For the cases where I was looking at netns leaks, there were no more
> processes in the container, so there was no way to enter the container
> and spawn a socket at that point.
Then how do you get net->ns.inum ?
>
> The point of the symlinks is to have a way to easily identify what
> you're tracking. NAME_MAX is 255. We could do something like this
> instead:
>
> snprintf(..., "netns-%u-%llx-refcnt", net->ns.inum, net->net_cookie);
>
> Obviously the inums would all be 1 when PROC_FS=n, but the cookies
> would be unique. Would that work?
This works, but depending on the question above, there's no point in
using inum ?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns
2025-05-01 3:50 ` Kuniyuki Iwashima
@ 2025-05-01 4:07 ` Jeff Layton
2025-05-01 4:26 ` Kuniyuki Iwashima
0 siblings, 1 reply; 19+ messages in thread
From: Jeff Layton @ 2025-05-01 4:07 UTC (permalink / raw)
To: Kuniyuki Iwashima
Cc: airlied, akpm, andrew, davem, dri-devel, edumazet, horms,
intel-gfx, jani.nikula, joonas.lahtinen, kuba, linux-kernel,
maarten.lankhorst, mripard, nathan, netdev, pabeni, qasdev00,
rodrigo.vivi, simona, tursulin, tzimmermann
On Wed, 2025-04-30 at 20:50 -0700, Kuniyuki Iwashima wrote:
> From: Jeff Layton <jlayton@kernel.org>
> Date: Wed, 30 Apr 2025 20:42:40 -0700
> > On Wed, 2025-04-30 at 20:07 -0700, Kuniyuki Iwashima wrote:
> > > From: Jeff Layton <jlayton@kernel.org>
> > > Date: Wed, 30 Apr 2025 19:59:23 -0700
> > > > On Wed, 2025-04-30 at 14:29 -0700, Kuniyuki Iwashima wrote:
> > > > > From: Jeff Layton <jlayton@kernel.org>
> > > > > Date: Wed, 30 Apr 2025 08:06:54 -0700
> > > > > > After assigning the inode number to the namespace, use it to create a
> > > > > > unique name for each netns refcount tracker with the ns.inum value in
> > > > > > it, and register a symlink to the debugfs file for it.
> > > > > >
> > > > > > init_net is registered before the ref_tracker dir is created, so add a
> > > > > > late_initcall() to register its files and symlinks.
> > > > > >
> > > > > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > > > > > ---
> > > > > > net/core/net_namespace.c | 28 +++++++++++++++++++++++++++-
> > > > > > 1 file changed, 27 insertions(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> > > > > > index 008de9675ea98fa8c18628b2f1c3aee7f3ebc9c6..6cbc8eabb8e56c847fc34fa8ec9994e8b275b0af 100644
> > > > > > --- a/net/core/net_namespace.c
> > > > > > +++ b/net/core/net_namespace.c
> > > > > > @@ -763,12 +763,38 @@ struct net *get_net_ns_by_pid(pid_t pid)
> > > > > > }
> > > > > > EXPORT_SYMBOL_GPL(get_net_ns_by_pid);
> > > > > >
> > > > > > +#ifdef CONFIG_NET_NS_REFCNT_TRACKER
> > > > > > +static void net_ns_net_debugfs(struct net *net)
> > > > > > +{
> > > > > > + ref_tracker_dir_symlink(&net->refcnt_tracker, "netns-%u-refcnt", net->ns.inum);
> > > > > > + ref_tracker_dir_symlink(&net->notrefcnt_tracker, "netns-%u-notrefcnt", net->ns.inum);
> > > > >
> > > > > Could you use net->net_cookie ?
> > > > >
> > > > > net->ns.inum is always 1 when CONFIG_PROC_FS=n.
> > > >
> > > > My main use-case for this is to be able to match the inode number in
> > > > the /proc/<pid>/ns/net symlink with the correct ref_tracker debugfs
> > > > file. Is there a way to use the net_cookie to make that association?
> > >
> > > It's roundabout, but net_cookie can be retrieved by creating a
> > > random socket in the netns and calling setsockopt(SO_NETNS_COOKIE).
> > >
> > > Ido proposed a handy ip-netns subcommand here, and I guess it will
> > > be implemented soon(?)
> > > https://lore.kernel.org/netdev/1d99d7ccfc3a7a18840948ab6ba1c0b5fad90901.camel@fejes.dev/
> >
> > For the cases where I was looking at netns leaks, there were no more
> > processes in the container, so there was no way to enter the container
> > and spawn a socket at that point.
>
> Then how do you get net->ns.inum ?
>
In my case, I was looking at /sys/kernel/debug/sunrpc/rpc_xprt/*/info.
That also displays net->ns.inum in the same format. When I was
originally working on this, the problem I was chasing was due to stuck
RPC transports (rpc_xprt).
>
> >
> > The point of the symlinks is to have a way to easily identify what
> > you're tracking. NAME_MAX is 255. We could do something like this
> > instead:
> >
> > snprintf(..., "netns-%u-%llx-refcnt", net->ns.inum, net->net_cookie);
> >
> > Obviously the inums would all be 1 when PROC_FS=n, but the cookies
> > would be unique. Would that work?
>
> This works, but depending on the question above, there's no point in
> using inum ?
Having the inum is definitely useful to me, particularly since the
net_cookie would be pretty useless for the problems I've been chasing.
I'll plan to respin this to include the net_cookie though, since that
would disambiguate the names when PROC_FS=n. It might also turn out to
be useful for someone, once there is a way to fetch the net_cookie from
userland.
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns
2025-05-01 4:07 ` Jeff Layton
@ 2025-05-01 4:26 ` Kuniyuki Iwashima
0 siblings, 0 replies; 19+ messages in thread
From: Kuniyuki Iwashima @ 2025-05-01 4:26 UTC (permalink / raw)
To: jlayton
Cc: airlied, akpm, andrew, davem, dri-devel, edumazet, horms,
intel-gfx, jani.nikula, joonas.lahtinen, kuba, kuniyu,
linux-kernel, maarten.lankhorst, mripard, nathan, netdev, pabeni,
qasdev00, rodrigo.vivi, simona, tursulin, tzimmermann
From: Jeff Layton <jlayton@kernel.org>
Date: Wed, 30 Apr 2025 21:07:20 -0700
> On Wed, 2025-04-30 at 20:50 -0700, Kuniyuki Iwashima wrote:
> > From: Jeff Layton <jlayton@kernel.org>
> > Date: Wed, 30 Apr 2025 20:42:40 -0700
> > > On Wed, 2025-04-30 at 20:07 -0700, Kuniyuki Iwashima wrote:
> > > > From: Jeff Layton <jlayton@kernel.org>
> > > > Date: Wed, 30 Apr 2025 19:59:23 -0700
> > > > > On Wed, 2025-04-30 at 14:29 -0700, Kuniyuki Iwashima wrote:
> > > > > > From: Jeff Layton <jlayton@kernel.org>
> > > > > > Date: Wed, 30 Apr 2025 08:06:54 -0700
> > > > > > > After assigning the inode number to the namespace, use it to create a
> > > > > > > unique name for each netns refcount tracker with the ns.inum value in
> > > > > > > it, and register a symlink to the debugfs file for it.
> > > > > > >
> > > > > > > init_net is registered before the ref_tracker dir is created, so add a
> > > > > > > late_initcall() to register its files and symlinks.
> > > > > > >
> > > > > > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > > > > > > ---
> > > > > > > net/core/net_namespace.c | 28 +++++++++++++++++++++++++++-
> > > > > > > 1 file changed, 27 insertions(+), 1 deletion(-)
> > > > > > >
> > > > > > > diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> > > > > > > index 008de9675ea98fa8c18628b2f1c3aee7f3ebc9c6..6cbc8eabb8e56c847fc34fa8ec9994e8b275b0af 100644
> > > > > > > --- a/net/core/net_namespace.c
> > > > > > > +++ b/net/core/net_namespace.c
> > > > > > > @@ -763,12 +763,38 @@ struct net *get_net_ns_by_pid(pid_t pid)
> > > > > > > }
> > > > > > > EXPORT_SYMBOL_GPL(get_net_ns_by_pid);
> > > > > > >
> > > > > > > +#ifdef CONFIG_NET_NS_REFCNT_TRACKER
> > > > > > > +static void net_ns_net_debugfs(struct net *net)
> > > > > > > +{
> > > > > > > + ref_tracker_dir_symlink(&net->refcnt_tracker, "netns-%u-refcnt", net->ns.inum);
> > > > > > > + ref_tracker_dir_symlink(&net->notrefcnt_tracker, "netns-%u-notrefcnt", net->ns.inum);
> > > > > >
> > > > > > Could you use net->net_cookie ?
> > > > > >
> > > > > > net->ns.inum is always 1 when CONFIG_PROC_FS=n.
> > > > >
> > > > > My main use-case for this is to be able to match the inode number in
> > > > > the /proc/<pid>/ns/net symlink with the correct ref_tracker debugfs
> > > > > file. Is there a way to use the net_cookie to make that association?
> > > >
> > > > It's roundabout, but net_cookie can be retrieved by creating a
> > > > random socket in the netns and calling setsockopt(SO_NETNS_COOKIE).
> > > >
> > > > Ido proposed a handy ip-netns subcommand here, and I guess it will
> > > > be implemented soon(?)
> > > > https://lore.kernel.org/netdev/1d99d7ccfc3a7a18840948ab6ba1c0b5fad90901.camel@fejes.dev/
> > >
> > > For the cases where I was looking at netns leaks, there were no more
> > > processes in the container, so there was no way to enter the container
> > > and spawn a socket at that point.
> >
> > Then how do you get net->ns.inum ?
> >
>
> In my case, I was looking at /sys/kernel/debug/sunrpc/rpc_xprt/*/info.
> That also displays net->ns.inum in the same format. When I was
> originally working on this, the problem I was chasing was due to stuck
> RPC transports (rpc_xprt).
Thanks for the info.
Prefarably the debugfs should also display netns_cookie instaed of inum,
and the change is acceptable as the debugfs is not uAPI.
Then we don't need to expose possibly non-unique value just for historical
reason.
>
>
> >
> > >
> > > The point of the symlinks is to have a way to easily identify what
> > > you're tracking. NAME_MAX is 255. We could do something like this
> > > instead:
> > >
> > > snprintf(..., "netns-%u-%llx-refcnt", net->ns.inum, net->net_cookie);
> > >
> > > Obviously the inums would all be 1 when PROC_FS=n, but the cookies
> > > would be unique. Would that work?
> >
> > This works, but depending on the question above, there's no point in
> > using inum ?
>
> Having the inum is definitely useful to me, particularly since the
> net_cookie would be pretty useless for the problems I've been chasing.
>
> I'll plan to respin this to include the net_cookie though, since that
> would disambiguate the names when PROC_FS=n. It might also turn out to
> be useful for someone, once there is a way to fetch the net_cookie from
> userland.
> --
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v6 06/10] ref_tracker: automatically register a file in debugfs for a ref_tracker_dir
2025-04-30 15:06 ` [PATCH v6 06/10] ref_tracker: automatically register a file in debugfs for a ref_tracker_dir Jeff Layton
@ 2025-05-05 8:05 ` Jani Nikula
0 siblings, 0 replies; 19+ messages in thread
From: Jani Nikula @ 2025-05-05 8:05 UTC (permalink / raw)
To: Jeff Layton, Andrew Morton, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
Cc: Kuniyuki Iwashima, Qasim Ijaz, Nathan Chancellor, Andrew Lunn,
linux-kernel, netdev, dri-devel, intel-gfx, Jeff Layton
On Wed, 30 Apr 2025, Jeff Layton <jlayton@kernel.org> wrote:
> Currently, there is no convenient way to see the info that the
> ref_tracking infrastructure collects. Attempt to create a file in
> debugfs when called from ref_tracker_dir_init().
>
> The file is given the name "class@%px", as having the unmodified address
> is helpful for debugging. This should be safe since this directory is only
> accessible by root
>
> If debugfs file creation fails, a pr_warn will be isssued.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> include/linux/ref_tracker.h | 14 +++++++++
> lib/ref_tracker.c | 73 +++++++++++++++++++++++++++++++++++++++++++--
> 2 files changed, 85 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/ref_tracker.h b/include/linux/ref_tracker.h
> index 2adae128d4b5e45f156af4775a1d184bb596fa91..c6e65d7ef4d4fc74c60fcabd19166c131d4173e2 100644
> --- a/include/linux/ref_tracker.h
> +++ b/include/linux/ref_tracker.h
> @@ -5,6 +5,7 @@
> #include <linux/types.h>
> #include <linux/spinlock.h>
> #include <linux/stackdepot.h>
> +#include <linux/seq_file.h>
Nothing here requires seq_file.h as far as I can tell. Please avoid
superfluous header dependencies.
BR,
Jani.
>
> struct ref_tracker;
>
> @@ -18,12 +19,17 @@ struct ref_tracker_dir {
> struct list_head list; /* List of active trackers */
> struct list_head quarantine; /* List of dead trackers */
> const char *class; /* object classname */
> +#ifdef CONFIG_DEBUG_FS
> + struct dentry *dentry;
> +#endif
> char name[32];
> #endif
> };
>
> #ifdef CONFIG_REF_TRACKER
>
> +void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir);
> +
> static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
> unsigned int quarantine_count,
> const char *class,
> @@ -37,7 +43,11 @@ static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
> refcount_set(&dir->untracked, 1);
> refcount_set(&dir->no_tracker, 1);
> dir->class = class;
> +#ifdef CONFIG_DEBUG_FS
> + dir->dentry = NULL;
> +#endif
> strscpy(dir->name, name, sizeof(dir->name));
> + ref_tracker_dir_debugfs(dir);
> stack_depot_init();
> }
>
> @@ -66,6 +76,10 @@ static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
> {
> }
>
> +static inline void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir)
> +{
> +}
> +
> static inline void ref_tracker_dir_exit(struct ref_tracker_dir *dir)
> {
> }
> diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c
> index b69c11e83c18c19aaa2dc23f802291d4a7e82a66..3ee4fd0f33407881cfa140dcb7d8b40e3c2722de 100644
> --- a/lib/ref_tracker.c
> +++ b/lib/ref_tracker.c
> @@ -31,6 +31,14 @@ struct ref_tracker_dir_stats {
> } stacks[];
> };
>
> +#ifdef CONFIG_DEBUG_FS
> +static void ref_tracker_debugfs_remove(struct ref_tracker_dir *dir);
> +#else
> +static inline void ref_tracker_debugfs_remove(struct ref_tracker_dir *dir)
> +{
> +}
> +#endif
> +
> static struct ref_tracker_dir_stats *
> ref_tracker_get_stats(struct ref_tracker_dir *dir, unsigned int limit)
> {
> @@ -197,6 +205,7 @@ void ref_tracker_dir_exit(struct ref_tracker_dir *dir)
> bool leak = false;
>
> dir->dead = true;
> + ref_tracker_debugfs_remove(dir);
> spin_lock_irqsave(&dir->lock, flags);
> list_for_each_entry_safe(tracker, n, &dir->quarantine, head) {
> list_del(&tracker->head);
> @@ -313,8 +322,7 @@ EXPORT_SYMBOL_GPL(ref_tracker_free);
> #ifdef CONFIG_DEBUG_FS
> #include <linux/debugfs.h>
>
> -static __maybe_unused int
> -ref_tracker_dir_seq_print(struct ref_tracker_dir *dir, struct seq_file *seq)
> +static int ref_tracker_dir_seq_print(struct ref_tracker_dir *dir, struct seq_file *seq)
> {
> struct ostream os = { .func = pr_ostream_seq,
> .prefix = "",
> @@ -328,6 +336,67 @@ ref_tracker_dir_seq_print(struct ref_tracker_dir *dir, struct seq_file *seq)
> return os.used;
> }
>
> +static int ref_tracker_debugfs_show(struct seq_file *f, void *v)
> +{
> + struct ref_tracker_dir *dir = f->private;
> +
> + return ref_tracker_dir_seq_print(dir, f);
> +}
> +
> +static int ref_tracker_debugfs_open(struct inode *inode, struct file *filp)
> +{
> + struct ref_tracker_dir *dir = inode->i_private;
> +
> + return single_open(filp, ref_tracker_debugfs_show, dir);
> +}
> +
> +static const struct file_operations ref_tracker_debugfs_fops = {
> + .owner = THIS_MODULE,
> + .open = ref_tracker_debugfs_open,
> + .read = seq_read,
> + .llseek = seq_lseek,
> + .release = single_release,
> +};
> +
> +/**
> + * ref_tracker_dir_debugfs - create debugfs file for ref_tracker_dir
> + * @dir: ref_tracker_dir to be associated with debugfs file
> + *
> + * In most cases, a debugfs file will be created automatically for every
> + * ref_tracker_dir. If the object was created before debugfs is brought up
> + * then that may fail. In those cases, it is safe to call this at a later
> + * time to create the file.
> + */
> +void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir)
> +{
> + char name[NAME_MAX + 1];
> + int ret;
> +
> + /* No-op if already created */
> + if (!IS_ERR_OR_NULL(dir->dentry))
> + return;
> +
> + ret = snprintf(name, sizeof(name), "%s@%px", dir->class, dir);
> + name[sizeof(name) - 1] = '\0';
> +
> + if (ret < sizeof(name))
> + dir->dentry = debugfs_create_file(name, S_IFREG | 0400,
> + ref_tracker_debug_dir, dir,
> + &ref_tracker_debugfs_fops);
> + else
> + dir->dentry = ERR_PTR(-ENAMETOOLONG);
> +
> + if (IS_ERR(dir->dentry))
> + pr_warn("ref_tracker: unable to create debugfs file for %s: %pe\n",
> + name, dir->dentry);
> +}
> +EXPORT_SYMBOL(ref_tracker_dir_debugfs);
> +
> +static void ref_tracker_debugfs_remove(struct ref_tracker_dir *dir)
> +{
> + debugfs_remove(dir->dentry);
> +}
> +
> static int __init ref_tracker_debugfs_init(void)
> {
> ref_tracker_debug_dir = debugfs_create_dir("ref_tracker", NULL);
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2025-05-05 8:05 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30 15:06 [PATCH v6 00/10] ref_tracker: add ability to register a debugfs file for a ref_tracker_dir Jeff Layton
2025-04-30 15:06 ` [PATCH v6 01/10] ref_tracker: don't use %pK in pr_ostream() output Jeff Layton
2025-04-30 15:06 ` [PATCH v6 02/10] ref_tracker: add a top level debugfs directory for ref_tracker Jeff Layton
2025-04-30 15:06 ` [PATCH v6 03/10] ref_tracker: have callers pass output function to pr_ostream() Jeff Layton
2025-04-30 15:06 ` [PATCH v6 04/10] ref_tracker: add a static classname string to each ref_tracker_dir Jeff Layton
2025-04-30 15:06 ` [PATCH v6 05/10] ref_tracker: allow pr_ostream() to print directly to a seq_file Jeff Layton
2025-04-30 15:06 ` [PATCH v6 06/10] ref_tracker: automatically register a file in debugfs for a ref_tracker_dir Jeff Layton
2025-05-05 8:05 ` Jani Nikula
2025-04-30 15:06 ` [PATCH v6 07/10] ref_tracker: add a way to create a symlink to the ref_tracker_dir debugfs file Jeff Layton
2025-04-30 15:06 ` [PATCH v6 08/10] net: add symlinks to ref_tracker_dir for netns Jeff Layton
2025-04-30 21:29 ` Kuniyuki Iwashima
2025-05-01 2:59 ` Jeff Layton
2025-05-01 3:07 ` Kuniyuki Iwashima
2025-05-01 3:42 ` Jeff Layton
2025-05-01 3:50 ` Kuniyuki Iwashima
2025-05-01 4:07 ` Jeff Layton
2025-05-01 4:26 ` Kuniyuki Iwashima
2025-04-30 15:06 ` [PATCH v6 09/10] i915: add ref_tracker_dir symlinks for each tracker Jeff Layton
2025-04-30 15:06 ` [PATCH v6 10/10] ref_tracker: eliminate the ref_tracker_dir name field Jeff Layton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).