[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220425172014.GA24181@wunner.de>
Date: Mon, 25 Apr 2022 19:20:14 +0200
From: Lukas Wunner <lukas@...ner.de>
To: Jann Horn <jannh@...gle.com>
Cc: Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Oliver Neukum <oneukum@...e.com>,
"David S. Miller" <davem@...emloft.net>,
Oleksij Rempel <o.rempel@...gutronix.de>,
netdev <netdev@...r.kernel.org>,
USB list <linux-usb@...r.kernel.org>,
Andrew Lunn <andrew@...n.ch>,
Jacky Chou <jackychou@...x.com.tw>, Willy Tarreau <w@....eu>,
Lino Sanfilippo <LinoSanfilippo@....de>,
Philipp Rosenberger <p.rosenberger@...bus.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] net: linkwatch: ignore events for unregistered netdevs
On Mon, Apr 25, 2022 at 05:18:51PM +0200, Jann Horn wrote:
> Well, it's not quite a refcount. It's a count that can be incremented
> and decremented but can't be read while the device is alive, and then
> at some point it turns into a count that can be read and decremented
> but can't be incremented
Pardon me for being dense, but most other subsystems use the refcounting
built into struct device (or rather, its kobject) and tear it down
when the refcount reaches zero (e.g. pci_release_dev(), spidev_release()).
What's the rationale for struct net_device rolling its own refcounting?
Historic artifact?
I think a lot of these issues would solve themselves if that was done away
with and replaced with the generic kobject refcounting. It's a pity that
the tracking infrastructure is now netdev-specific and other subsystems
cannot benefit from it.
Thanks,
Lukas
Powered by blists - more mailing lists