login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
December
»
15
Re: kobject ->k_name memory leak
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Kay Sievers <kay.sievers@...>
To: Alexey Dobriyan <adobriyan@...>
Cc: Greg KH <greg@...>, Greg KH <gregkh@...>, Alexey Dobriyan <adobriyan@...>, <akpm@...>, <linux-kernel@...>
Subject:
Re: kobject ->k_name memory leak
Date: Saturday, December 15, 2007 - 11:19 am
On Sat, 2007-12-15 at 16:34 +0300, Alexey Dobriyan wrote:
quoted text
> On Fri, Dec 14, 2007 at 01:48:23PM -0800, Greg KH wrote: > > On Mon, Dec 03, 2007 at 01:25:51PM -0800, Greg KH wrote: > > > On Tue, Dec 04, 2007 at 12:09:59AM +0300, Alexey Dobriyan wrote: > > > > On Mon, Dec 03, 2007 at 12:47:16PM -0800, Greg KH wrote: > > > > > On Mon, Dec 03, 2007 at 12:26:07PM +0300, Alexey Dobriyan wrote: > > > > > > Hi, Greg! > > > > > > > > > > > > Commit ce2c9cb0259acd2aed184499ebe41ab00da13b25 aka > > > > > > "kobject: remove the static array for the name" introduced memory leak > > > > > > of a module name after modprobe/rmmod. Apparently for modules ->release > > > > > > callback is NULL. > > > > > > > > > > > > kobject_cleanup: ->release = 00000000, name = 'foo_sysctl' > > > > > > Pid: 1927, comm: rmmod Not tainted 2.6.24-rc3-e1cca7e8d484390169777b423a7fe46c7021fec1 #5 > > > > > > [<c10d4a58>] kobject_cleanup+0xb8/0xc0 > > > > > > [<c10d4a60>] kobject_release+0x0/0x10 > > > > > > [<c10d587b>] kref_put+0x2b/0xa0 > > > > > > [<c11dbe85>] _spin_unlock+0x25/0x40 > > > > > > [<c1045b78>] free_module+0x78/0xd0 > > > > > > [<c104773f>] sys_delete_module+0x12f/0x1a0 > > > > > > > > > > Hm, _which_ kobject associated with a module, there are 3 of them I > > > > > think :) > > > > > > > > Ouch! > > > > > > > > > They should all have a release function, and if they do not, we think > > > > > it's a "static" kobject and it is not safe to free that name. > > > > > > > > > > I've been working on cleaning this up a lot in the -mm tree with over 80 > > > > > patches for the kset/kobject apis and interfaces. > > > > > > > > > > But if we have a dynamic kobject, and we aren't freeing it properly, > > > > > please let me know which one it is and I'll work to fix it for 2.6.24. > > > > > > > > The one which is passed to kobject_set_name() in mod_sysfs_init().. > > > > > > That one should be set to the module_ktype, which is in kernel/params.c, > > > so the release function there should... oh crap, there is no release > > > function. That's a bug. After I get out of meetings tonight I'll write > > > up a patch for that, unless someone beats me to it :) > > > > Ok, this is a mess. We can't really have a release function for this > > kobject, as the structure it is embedded it has it's own memory > > management issues. > > > > To fix this properly is going to take some major kobject/module surgery, > > it's not a simple fix at all. I'll tackle it for 2.6.25, as it fits in > > nicely with the other kobject rework that I've already done in the -mm > > tree. > > > > So, for now, can we just live with this tiny memory leak on module > > unload? > > For the record, this leak screws any testing one can do wrt module > unload races. You can't really leave box overnight running > modprobe/rmmod in a loop, because OOM killer will finally kick in. > Hey, this is exactly how it was noticed at all. > > > Or is the above trace something that users will see when unloading > > modules? > > No, it's added debugging.
Can't we add an empty release function? It would free the name with the current logic, right? Kay --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
kobject ->k_name memory leak
, Alexey Dobriyan
, (Mon Dec 3, 5:26 am)
Re: kobject ->k_name memory leak
, Greg KH
, (Mon Dec 3, 4:47 pm)
Re: kobject ->k_name memory leak
, Alexey Dobriyan
, (Mon Dec 3, 5:09 pm)
Re: kobject ->k_name memory leak
, Greg KH
, (Mon Dec 3, 5:25 pm)
Re: kobject ->k_name memory leak
, Greg KH
, (Fri Dec 14, 5:48 pm)
Re: kobject ->k_name memory leak
, Alexey Dobriyan
, (Sat Dec 15, 9:34 am)
Re: kobject ->k_name memory leak
, Kay Sievers
, (Sat Dec 15, 11:19 am)
Re: kobject ->k_name memory leak
, Greg KH
, (Thu Dec 20, 6:04 pm)
Re: kobject ->k_name memory leak
, Alexey Dobriyan
, (Sat Dec 22, 8:07 am)
Re: kobject ->k_name memory leak
, Greg KH
, (Sun Dec 23, 1:55 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Heiko Carstens
Re: -mm merge plans for 2.6.23 -- sys_fallocate
Tarkan Erimer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Eric W. Biederman
[PATCH 0/10] sysfs network namespace support
git
:
linux-netdev
:
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
David Miller
[GIT]: Networking
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Natalie Protasevich
[BUG] New Kernel Bugs
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
12 users
and
891 guests
online.
Online users
reversecellpho
zeekec
waystogetyoure
fantasyswordsq
rockytherobohl
fujii
ewenchiaautopi
doglovers95
farmvillengc
hotelyymod
colorecalcance
winterizingbln
Syndicate