[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d120d5000704161320x6a9be38dqc71d708e534dd7b4@mail.gmail.com>
Date: Mon, 16 Apr 2007 16:20:18 -0400
From: "Dmitry Torokhov" <dmitry.torokhov@...il.com>
To: "Greg KH" <greg@...ah.com>
Cc: "Cornelia Huck" <cornelia.huck@...ibm.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
"Alan Stern" <stern@...land.harvard.edu>,
"Tejun Heo" <htejun@...il.com>,
"Rusty Russell" <rusty@...tcorp.com.au>
Subject: Re: [Patch -mm 0/3] RFC: module unloading vs. release function
On 4/16/07, Greg KH <greg@...ah.com> wrote:
> On Mon, Apr 16, 2007 at 03:03:16PM -0400, Dmitry Torokhov wrote:
> > On 4/16/07, Greg KH <greg@...ah.com> wrote:
> > >On Mon, Apr 16, 2007 at 02:30:17PM -0400, Dmitry Torokhov wrote:
> > >> On 4/16/07, Cornelia Huck <cornelia.huck@...ibm.com> wrote:
> > >> >Hi,
> > >> >
> > >> >based on the discussion in "How should an exit routine wait for
> > >> >release() callbacks?", I've cooked up some patches that make module
> > >> >unload wait until the last reference for a kobject has been dropped.
> > >> >This should plug the "release function in already deleted module" race;
> > >> >however, if the last kobject_put() from the module containing the
> > >> >release function is not in the module's exit function, there's still a
> > >> >small window (not sure if and how to plug this).
> > >>
> > >> Unfortunately all this "wait for refcount in module's exit" schemas
> > >> lead to the following deadlock:
> > >>
> > >> rmmod my_module < /path/to/some/file/incrementing/my/refcount
> > >
> > >No, it should just return "module in use" as the reference count it
> > >grabbed before rmmod is called.
> > >
> >
> > No, because it it were module's refcount we woudl not have problem
> > with ->release() to begin with. It is object's refcount.
>
> Yes, but with these patches, we are incrementing that reference count
> when the kobject is created, which will cause this to fail.
>
Then you will never be able to unload the module, not with the current
module tools.
> > >But either way, that's just foolish to try to prevent that from failing
> > >:)
> >
> > Why? It works now for most of teh subsystems.
>
> That's because it is buggy :)
>
Depends on the subsystem.
--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists