From: Louis Rilling <Louis.Rilling@kerlabs.com>
To: Joel.Becker@oracle.com
Cc: ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC] configfs: module reference counting rules
Date: Mon, 16 Jun 2008 20:14:28 +0200 [thread overview]
Message-ID: <20080616181428.GW30804@localhost> (raw)
In-Reply-To: <20080616180643.GC9657@mail.oracle.com>
[-- Attachment #1: Type: text/plain, Size: 903 bytes --]
On Mon, Jun 16, 2008 at 11:06:43AM -0700, Joel Becker wrote:
> > > Why can't mod_b provide a ->release() that does
> > > module_put(self)?
> >
> > Because this is simply wrong. Doing module_put(self) exposes the modules's
> > function to be run while another cpu unloads the module. Note how I solve this
>
> How so? As long as the module_put() is the last thing, you're
> fine. That said, we both have better solutions with our wrappered
> functions.
With a preemptible kernel, after module_put(self) the few assembly instructions
cleaning up the stack before returning to the caller can be called after the
memory allocated for the module has been freed. Which will make the kernel
crash.
Louis
--
Dr Louis Rilling Kerlabs
Skype: louis.rilling Batiment Germanium
Phone: (+33|0) 6 80 89 08 23 80 avenue des Buttes de Coesmes
http://www.kerlabs.com/ 35700 Rennes
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-06-16 18:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-12 23:54 [RFC] configfs: module reference counting rules Louis Rilling
2008-06-13 3:33 ` Joel Becker
2008-06-13 9:51 ` Louis Rilling
2008-06-13 20:26 ` Joel Becker
2008-06-13 22:27 ` Louis Rilling
2008-06-14 8:47 ` Joel Becker
2008-06-16 12:39 ` Louis Rilling
2008-06-16 18:06 ` Joel Becker
2008-06-16 18:14 ` Louis Rilling [this message]
2008-06-16 19:36 ` Joel Becker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080616181428.GW30804@localhost \
--to=louis.rilling@kerlabs.com \
--cc=Joel.Becker@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox