Re: [PATCH] EDAC: core EDAC support code



On Monday 06 March 2006 13:32, Al Viro wrote:
On Mon, Mar 06, 2006 at 01:01:37PM -0800, Dave Peterson wrote:
Regarding the above problem with the kobject reference count, this
was recently fixed in the -mm tree (see edac-kobject-sysfs-fixes.patch
in 2.6.16-rc5-mm2). The fix I implemented was to add a call to
complete() in edac_memctrl_master_release() and then have the module
cleanup code wait for the completion. I think there were a few other
instances of this type of problem that I also fixed in the
above-mentioned patch.

This is not a fix, this is a goddamn deadlock.
rmmod your_turd </sys/spew/from/your_turd
and there you go. rmmod can _NOT_ wait for sysfs references to go away.

Ok, how does this sound:

- Modify EDAC so it uses kmalloc() to create the kobject.
- Eliminate edac_memctrl_master_release(). Instead, use kfree() as
the release method for the kobject. Here, it's important to use a
function -outside- of EDAC as the release method since the core
EDAC module may have been unloaded by the time the release method
is called.
- Make similar modifications to the other places in EDAC where
kobjects are used.

At least this will keep the module unload operation from blocking
in the module cleanup function due to a nonzero kobject reference
count. I'm going to be away from my keyboard for most of the rest of
today. However, if there is general agreement that this is a
reasonable way to proceed, I'll make a patch that implements this
tomorrow.

Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH] EDAC: core EDAC support code
    ... cleanup code wait for the completion. ... This is not a fix, ... Modify EDAC so it uses kmallocto create the kobject. ...
    (Linux-Kernel)
  • Re: [PATCH] EDAC: core EDAC support code
    ... Modify EDAC so it uses kmallocto create the kobject. ... I did that for the module core ... code and it's on my todo list for the driver core too. ...
    (Linux-Kernel)
  • Re: [PATCH] EDAC: core EDAC support code
    ... Modify EDAC so it uses kmallocto create the kobject. ... for a driver that creates/destroys device objects. ... core split from drivers code - then you can keep core module reference ...
    (Linux-Kernel)
  • linux-next: upstream build failure: pasemi_edac
    ... Caused by commit c3c52bce6993c6d37af2c2de9b482a7013d646a7 ("edac: fix ... module initialization on several modules 2nd time") which added a call to ...
    (Linux-Kernel)
  • Re: [PATCH] Mark kobjects as unitialized
    ... On Monday 10 March 2008 09:22:00 pm Greg KH wrote: ... AFAICS the best way to solve this is by fixing the kobject users ... how about this patch instead? ... But we should fix the sys_device users later, ...
    (Linux-Kernel)