[PATCH net v3 1/1] net: phylink: Add module_exit()

Gan, Yi Fang yi.fang.gan at intel.com
Wed Jan 10 22:38:58 PST 2024



> -----Original Message-----
> From: Andrew Lunn <andrew at lunn.ch>
> Sent: Thursday, January 4, 2024 9:05 PM
> To: Gan, Yi Fang <yi.fang.gan at intel.com>
> Cc: Russell King <linux at armlinux.org.uk>; Heiner Kallweit
> <hkallweit1 at gmail.com>; David S . Miller <davem at davemloft.net>; Eric
> Dumazet <edumazet at google.com>; Jakub Kicinski <kuba at kernel.org>; Paolo
> Abeni <pabeni at redhat.com>; Marek Behún <kabel at kernel.org>;
> netdev at vger.kernel.org; linux-stm32 at st-md-mailman.stormreply.com; linux-
> arm-kernel at lists.infradead.org; linux-kernel at vger.kernel.org; Looi, Hong Aun
> <hong.aun.looi at intel.com>; Voon, Weifeng <weifeng.voon at intel.com>; Song,
> Yoong Siang <yoong.siang.song at intel.com>; Choong, Yong Liang
> <yong.liang.choong at intel.com>
> Subject: Re: [PATCH net v3 1/1] net: phylink: Add module_exit()
> 
> On Thu, Jan 04, 2024 at 06:12:55PM +0800, Gan, Yi Fang wrote:
> 65;7401;1c> In delete_module(), if mod->init callback is defined but mod->exit
> callback
> > is not defined, it will assume the module cannot be removed and return
> > EBUSY. The module_exit() is missing from current phylink module drive
> > causing failure while unloading it.
> 
> This is still missing the explanation why this is safe.
> 
> 
>     Andrew
> 
> ---
> pw-bot: cr

Hi Andrew,

Regarding the justification on why it is safe to remove phylink, 
we had done some memory leak check when unloading the phylink module.
 
root at localhost:~# lsmod | grep "phylink"
phylink               73728  0
root at localhost:~# rmmod phylink
root at localhost:~# echo scan > /sys/kernel/debug/kmemleak
root at localhost:~# cat /sys/kernel/debug/kmemleak
root at localhost:~#
 
So far, we didn't observe any memory leaking happened when unloading
phylink module. Is it sufficient or do you have any other suggestions to check 
on whether the module is safe to remove?

Best Regards,
Gan Yi Fang



More information about the linux-arm-kernel mailing list