Messages in this thread | | | Date | Mon, 30 Sep 2013 19:02:23 -0700 | Subject | Re: spinlock contention of files->file_lock | From | Linus Torvalds <> |
| |
On Mon, Sep 30, 2013 at 6:53 PM, Al Viro <viro@zeniv.linux.org.uk> wrote: > > The problem is dup2()
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).
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.
Linus
| |