All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH][RFC] %pd - for printing dentry name
Date: Mon, 1 Feb 2010 23:18:47 +0000	[thread overview]
Message-ID: <20100201231847.GC12882@ZenIV.linux.org.uk> (raw)
In-Reply-To: <alpine.LFD.2.00.1002011431490.3664@localhost.localdomain>

On Mon, Feb 01, 2010 at 02:37:32PM -0800, Linus Torvalds wrote:

> > * don't use %pd under dentry->d_lock, use dentry->d_name.name instead; in
> > that case it *is* safe.  Incidentally, ->d_lock isn't held a lot.
> 
> I realize we can just call it a rule, and yes, d_lock is held much less 
> than something like console_lock etc that we've had ABBA issues with, but 
> still..

> Quite frankly, I'd _much_ rather see something like just always freeing 
> the dentry names (when they aren't inlined) using RCU. The VFS layer quite 
> possibly would want to do that anyway at some point (eg Nick's VFS 
> scalability patches), and then we could make it just a RCU read-lock or 
> whatever (interrupt disable, what-not) instead.
> 
> And I'm much happier with printk doing that kind of thing, and wouldn't 
> have issues with that kind of much weaker locking.

Ehh...  RCU will save you from stepping on freed memory, but it still will
leave the joy of half-updated string with length out of sync with it, etc.
We probably can get away with that, but we'll have to be a lot more careful
with the order of updating these suckers in d_move_locked et.al.

I don't know...  Note that if we end up adding something extra to struct
dentry, we might as well just add *another* spinlock, taken only under
->d_lock and only in two places in dcache.c that change d_name.  That kind
of thing is trivial to enforce (just grep over the tree once in a while)
and if it shares the cacheline with d_lock, we shouldn't get any real overhead
in d_move()/d_materialise_unique().  I'm not particulary fond of that variant,
but it's at least guaranteed to be devoid of subtleties.

If RCU folks can come up with a sane suggestions that would be robust and
wouldn't bloat dentry - sure, I'm all for it.  If not...

  reply	other threads:[~2010-02-01 23:18 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01 22:25 [PATCH][RFC] %pd - for printing dentry name Al Viro
2010-02-01 22:34 ` Al Viro
2010-02-01 22:37 ` Linus Torvalds
2010-02-01 23:18   ` Al Viro [this message]
2010-02-02  1:06     ` Al Viro
2010-02-02  5:55       ` Eric W. Biederman
2010-02-02 17:01         ` Al Viro
2010-02-02 18:10           ` Olivier Galibert
2010-02-02 19:19           ` Eric W. Biederman
2010-02-03  3:04             ` Al Viro
2010-02-04  4:53               ` Al Viro
2010-02-02  4:22     ` Linus Torvalds
2010-02-02  5:00       ` Al Viro
2010-02-02  6:36         ` Nick Piggin
2010-02-04  6:02           ` Al Viro
2010-02-04  7:40             ` Nick Piggin
2010-02-02  6:53     ` Paul E. McKenney
2010-02-02  7:09       ` Al Viro
2010-02-02 13:32         ` Matthew Wilcox
2010-02-02 15:56           ` Linus Torvalds
2010-02-02 16:13             ` Matthew Wilcox
2010-02-02 16:43           ` Al Viro
2010-02-03 10:52         ` Paul E. McKenney
2010-02-03  2:49       ` Paul E. McKenney
2010-02-04 15:29         ` Linus Torvalds
2010-02-04 16:02           ` Paul E. McKenney
2010-02-04 17:13             ` Linus Torvalds
2010-02-04 17:36               ` Al Viro
2010-02-07 16:34                 ` Paul E. McKenney
2010-02-01 22:45 ` Joe Perches

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=20100201231847.GC12882@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.