[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1380589503.5326.13.camel@edumazet-glaptop.roam.corp.google.com>
Date: Mon, 30 Sep 2013 18:05:03 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>
Cc: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Waiman Long <Waiman.Long@...com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
"Chandramouleeswaran, Aswin" <aswin@...com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: spinlock contention of files->file_lock
Speaking of spinlock contention, the files->file_lock is a good example.
Multi threaded programs hit this spinlock three times per fd :
alloc_fd() / fd_install() / close()
I think fd_install() could be done without this spinlock.
we want to protect fd_install() from a concurrent resize of the fd
table.
We could either :
- Add a spinlock used for resize, and fd_install().
A bit suboptimal but easy to code and review.
- Add a seqcount, and cmpxchg() to synchronize fd_install() with the
potential resizer. (Might need additional RCU locking)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists