lkml.org 
[lkml]   [2004]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Unregistering interfaces
    On Mon, Mar 29, 2004 at 04:01:29PM -0800, Greg KH wrote:
    > On Mon, Mar 29, 2004 at 03:31:17PM -0800, Andrew Morton wrote:
    > > Greg KH <greg@kroah.com> wrote:
    > > >
    > > > > The module should remain in memory, "unhashed", until the final kobject
    > > > > reference falls to zero. Destruction of that kobject causes the refcount
    > > > > on the module to fall to zero which causes the entire module to be
    > > > > released.
    > > > >
    > > > > (hmm, the existence of a kobject doesn't appear to contribute to its
    > > > > module's refcount. Why not?)
    > > >
    > > > It does, if a file for that kobject is opened. In this case, there was
    > > > no file opened, so the module refcount isn't incremented.
    > >
    > > hm, surprised. Shouldn't the existence of a kobject contribute to its
    > > module's refcount?
    >
    > No, a kobject by itself knows nothing about a module. Only the
    > attribute files do (and they are the things that contain the struct
    > module *), as they are what user space can grab references to.
    >
    > I never thought that the kobject would care, as it is only a directory,
    > and I didn't think that anything could grab directory references on
    > their own. But then Maneesh's patch wasn't in the kernel at that time
    > :)
    >

    I don't how fisible is it to move the owner field to the kobject and keep the
    module and kobject both alive as long as there are sysfs directories referring
    to them.

    Maneesh


    --
    Maneesh Soni
    Linux Technology Center,
    IBM Software Lab, Bangalore, India
    email: maneesh@in.ibm.com
    Phone: 91-80-25044999 Fax: 91-80-25268553
    T/L : 9243696
    -
    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/

    \
     
     \ /
      Last update: 2005-03-22 14:02    [W:6.182 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site