linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Waiman Long <Waiman.Long@hp.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"Chandramouleeswaran, Aswin" <aswin@hp.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: spinlock contention of files->file_lock
Date: Tue, 1 Oct 2013 04:27:15 +0100	[thread overview]
Message-ID: <20131001032715.GW13318@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFz3gJE_DpZufTDNoRZ=vgJS3OwMspR7ZSqzGY_rWMq4gQ@mail.gmail.com>

On Mon, Sep 30, 2013 at 07:02:23PM -0700, Linus Torvalds wrote:

> Shouldn't a cmpxchg() in just the dup2 code solve that?
> 
> If the old value was NULL, you'd have to repeat and go back and see if
> the open_fds[] bit had been cleared in the meantime (ie it's NULL not
> because somebody else is busy installing it, but because somebody just
> uninstalled it).

Yechh...  Under ->file_lock (in do_dup2()), hopefully?  Or you'll get
all kinds of fun with close() thrown into the game, as well...

> But yeah, I do agree that that sounds nasty and a complication I
> hadn't even thought about. dup2() does violate our normal "let's
> pre-allocate the fd slot" rule. Ugh.

Hell knows...  Descriptor handling *is* pretty well isolated these
days, so it just might be doable without disrupting the living hell
out of anything else.  fs/file.c is pretty much it - everything else
goes through it.

I've enough on my plate at the moment with fs/namespace.c and fs/namei.c,
though, and praying hard fs/inode.c doesn't enter the game.  I _know_
that fs/notify will and I'm not enjoying that for a second.  BTW, has
eparis resurfaced with any fixes for *notify/umount races?  I don't seem
to have anything related in the mailbox, but...

  reply	other threads:[~2013-10-01  3:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30 19:29 Avoiding the dentry d_lock on final dput(), part deux: transactional memory Linus Torvalds
2013-09-30 20:01 ` Waiman Long
2013-09-30 20:04   ` Linus Torvalds
2013-10-02 14:56     ` Andi Kleen
2013-09-30 22:52 ` Benjamin Herrenschmidt
2013-10-01  0:36   ` Michael Neuling
2013-10-01  0:56     ` Linus Torvalds
2013-10-01  2:05       ` Benjamin Herrenschmidt
2013-10-01  3:13         ` Paul E. McKenney
2013-10-01  4:52           ` Michael Neuling
2013-10-01 12:16             ` Paul E. McKenney
2013-10-01 13:42               ` Paul E. McKenney
2013-10-01  1:05 ` spinlock contention of files->file_lock Eric Dumazet
2013-10-01  1:44   ` Linus Torvalds
2013-10-01  2:18     ` Eric Dumazet
2013-10-01 21:41     ` Eric Dumazet
2013-10-01 22:04       ` Al Viro
2013-10-01 22:21         ` Eric Dumazet
2013-10-02  5:13         ` Ingo Molnar
2013-10-02 10:20           ` Al Viro
2013-10-02 10:56             ` Ingo Molnar
2013-10-01  1:53   ` Al Viro
2013-10-01  2:02     ` Linus Torvalds
2013-10-01  3:27       ` Al Viro [this message]
2013-10-01  3:36         ` Eric Dumazet
2013-10-01  5:12           ` Eric Dumazet

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=20131001032715.GW13318@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=Waiman.Long@hp.com \
    --cc=aswin@hp.com \
    --cc=benh@kernel.crashing.org \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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 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).