linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Louis Rilling <Louis.Rilling@kerlabs.com>
To: Joel Becker <Joel.Becker@oracle.com>
Cc: linux-fsdevel@vger.kernel.org, cluster-devel@redhat.com,
	ocfs2-devel@oss.oracle.com
Subject: Re: [Ocfs2-devel] [RFC] configfs: Pin configfs subsystems separately from new config_items.
Date: Wed, 18 Jun 2008 18:51:01 +0200	[thread overview]
Message-ID: <20080618165101.GI30804@localhost> (raw)
In-Reply-To: <20080618161215.GA16780@ca-server1.us.oracle.com>

[-- Attachment #1: Type: text/plain, Size: 2684 bytes --]

On Wed, Jun 18, 2008 at 09:12:15AM -0700, Joel Becker wrote:
> On Wed, Jun 18, 2008 at 02:31:34PM +0200, Louis Rilling wrote:
> > On Tue, Jun 17, 2008 at 03:41:00PM -0700, Joel Becker wrote:
> > > However, if the subsystem is made up of multiple modules, this may not
> > > pin the subsystem.  Thus, it would be possible to unload the toplevel
> > > subsystem module while there is still a child item.  Thus, we now
> > > try_module_get() the subsystem's module.  This only really affects
> > > children of the toplevel subsystem group.  Deeper children already have
> > > their parents pinned.
> > 
> > Looks good to me.
> > 
> > What about new item module pinning versus a concurrent sys_delete_module() in a
> > preemptible kernel? AFAICS new_item pinning is just done too late to protect
> > anybody against sys_delete_module(). Shouldn't we remove new item module pinning
> > and let the subsystem do it?
> 
> 	Good catch.  Preempt doesn't matter - it could just be another
> CPU.
> 	Certainly if there are multiple modules the make_item() will
> have to pin the submodule before calling it.  But the common case isn't
> multiple modules.  What we absolutely don't want is making the common
> case have to pin itself.

I suspect the common case to not need to pin the new item: if we assume that the
parent is already pinned, it will remain pinned until the new item is dropped.
	I think that the following rules ensure that the parent's module is
always pinned:

1/ The subsystem root is pinned before creating any other subdir under a default
   group of its module (ok with your patch).

2/ A subsystem root having default groups in other modules pins these modules
   before register() and until unregister() (ok with in-tree subsystems I think,
   thanks to automatic module dependency tracking). This should mostly be done
   implicitly thanks to the module dependency tracking based on used symbols.

3/ Same as 2 but for a new group between allocation and release(). Here again,
   module dependency tracking should do the job most of the time.

4/ make_item()/make_group() pins the module of the new item/group if it differs
   from the current one, and at least until drop_item() (must check in-tree
   subsystems, but I suspect that module dependency tracking already does the
   job).

If you agree with these rules, which seem to be just reasonable, we should be
able to get rid of the new item's module pinning inside configfs.

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 --]

  reply	other threads:[~2008-06-18 16:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-17 22:41 [RFC] configfs: Pin configfs subsystems separately from new config_items Joel Becker
2008-06-18 12:31 ` [Ocfs2-devel] " Louis Rilling
2008-06-18 16:12   ` Joel Becker
2008-06-18 16:51     ` Louis Rilling [this message]
2008-06-18 20:07       ` Joel Becker
2008-06-19 11:13         ` [Ocfs2-devel] " Louis Rilling
2008-06-19 22:07           ` Joel Becker
2008-06-20 12:46             ` Louis Rilling
2008-06-20 22:36               ` Joel Becker
2008-06-23 15:44                 ` Louis Rilling
2008-06-23 19:10                   ` Joel Becker
2008-06-24  5:04                     ` Louis Rilling
2008-06-24 17:03                       ` 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=20080618165101.GI30804@localhost \
    --to=louis.rilling@kerlabs.com \
    --cc=Joel.Becker@oracle.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).