[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8bd706d6-1a85-4b36-a65a-fc6afe73950b@lunn.ch>
Date: Tue, 25 Mar 2025 14:00:26 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Jeff Layton <jlayton@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: add a debugfs files for showing netns refcount
tracking info
On Mon, Mar 24, 2025 at 08:37:57PM -0400, Jeff Layton wrote:
> On Mon, 2025-03-24 at 21:50 +0100, Andrew Lunn wrote:
> > On Mon, Mar 24, 2025 at 04:24:47PM -0400, Jeff Layton wrote:
> > > CONFIG_NET_NS_REFCNT_TRACKER currently has no convenient way to display
> > > its tracking info. Add a new net_ns directory in debugfs. Have a
> > > directory in there for every net, with refcnt and notrefcnt files that
> > > show the currently tracked active and passive references.
> >
> > Hi Jeff
> >
> > CONFIG_NET_NS_REFCNT_TRACKER is just an instance of
> > CONFIG_REF_TRACKER.
> >
> > It would be good to explain why you are doing it at the netdev level,
> > rather than part of the generic CONFIG_REF_TRACKER level. Why would
> > other subsystems not benefit from having their reference trackers in
> > debugfs?
> >
> >
>
> Mostly because I just needed the NS_REFCNT_TRACKER at the time.
>
> I'm OK with making this more general, but all of those subsystems using
> refcount trackers would need to add the infrastructure to create
> directories to track them.
The base directory can be created by ref_tracker itself.
> To whit:
>
> What would the directory structure look like for the more general case?
ref_tracker_dir_init(struct ref_tracker_dir *dir,
unsigned int quarantine_count,
const char *name)
and then each tracker use 'name' as the debugfs filename. You would
need to check it is unique before creating it, since uniqueness was
probably not a requirement before.
Andrew
Powered by blists - more mailing lists