linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: nfsd changes for 3.5
Date: Thu, 31 May 2012 15:14:57 -0700	[thread overview]
Message-ID: <CA+55aFxY+WJmMu=1Wvdh24kK0JWEuQ1vwcqZdaNDbp1_wUsZ4A@mail.gmail.com> (raw)
In-Reply-To: <20120531205300.GG25955@fieldses.org>

On Thu, May 31, 2012 at 1:53 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> On Thu, May 31, 2012 at 01:17:26PM -0700, Linus Torvalds wrote:
>
> Uh, that means ditching some work in my public git tree.  Which I
> haven't rebased in years.  So, a stupid process question; would you
> rather I:
>
>        - continue to be strict about rebasing and apply a bunch of
>          reverts?
>        - ditch it and start over?

I think in this case rebasing is the right thing to do.

I hate rebasing, but what I hate about it is how people who use it as
a development model cause problems for anybody else. I don't think it
will cause problems in this particular case, but if somebody hollers,
let me know.

>>  Making
>> it an rwsem might help readdir a tiny amount, but I suspect people
>> actually depend on the mutex in readdir right now.
>
> Al called this all "highly non-trivial":
>
>        http://marc.info/?l=linux-fsdevel&m=132726495726326&w=2
>
> I don't know who'd have the cycles.

I agree, it's a rats nest.

Doing lookups in particular is ridiculously single-threaded for almost
no good reason, though (and create is just a special case of that). It
*should* be possible that push the i_mutex down into the filesystem,
if we just created some fake dentry (with the appropriate support for
lookup to stall on it) to make sure that lookups of the same *name*
are serialized.

At that point, each filesystem could decide that they don't need the
i_mutex for the whole thing.

Maybe.

And readdir() could be done mostly mechanically by changing i_mutex
into an rwsem, making all lockers use a write lock, and pushing the
locking down from the caller into the filesystem for ->readdir().
Again, at that point, I suspect many filesystems could do with much
less locking.

But yeah, it's all nasty. Even the purely mechanical part of changing
i_mutex to an rwsem would not only be a *huge* and painful patch, it
would hit things like lockdep issues too (we don't support the nesting
thing for rwsem annotations, afaik).

So nobody has really done it, and it's so painful that maybe nobody
will. There are loads that hit this serialization point, but they are
*fairly* rare and specialized.

                Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-05-31 22:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 18:24 nfsd changes for 3.5 J. Bruce Fields
     [not found] ` <20120531182457.GB25955-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2012-05-31 18:58   ` Linus Torvalds
     [not found]     ` <CA+55aFwGpVM2Dbe02gL5=cGJZ_t3b4PTAhqwrs5MHjsb5R6BaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-31 20:01       ` J. Bruce Fields
     [not found]         ` <20120531200138.GD25955-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2012-05-31 20:17           ` Linus Torvalds
2012-05-31 20:53             ` J. Bruce Fields
2012-05-31 22:14               ` Linus Torvalds [this message]
2012-06-01  0:56                 ` J. Bruce Fields
2012-06-01 11:17                   ` J. Bruce Fields

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='CA+55aFxY+WJmMu=1Wvdh24kK0JWEuQ1vwcqZdaNDbp1_wUsZ4A@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=bfields@fieldses.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).