login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
September
»
30
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared futexes
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Ingo Molnar
Subject:
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared futexes
Date: Tuesday, September 30, 2008 - 3:39 am
* Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
quoted text
> On Tue, 2008-09-30 at 17:21 +1000, Nick Piggin wrote: > > On Sunday 28 September 2008 02:17, Ingo Molnar wrote: > > > * Peter Zijlstra <a.p.zijlstra@chello.nl> wrote: > > > > Since get_user_pages_fast() made it in, I thought to give this another > > > > try. Lightly tested by disabling the private futexes and running some > > > > java proglets. > > > > > > hm, very interesting. Since this is an important futex usecase i started > > > testing it in tip/core/futexes: > > > > > > cd33272: futex: cleanup fshared > > > a135356: futex: use fast_gup() > > > 39ce77b: futex: reduce mmap_sem usage > > > 0d7a336: futex: rely on get_user_pages() for shared futexes > > > > > > Nick, it would be nice to get an Acked-by/Reviewed-by from you, before > > > we think about whether it should go upstream. > > > > Yeah, these all look pretty good. It's nice to get rid of mmap sem here. > > > > Which reminds me, we need to put a might_lock mmap_sem into > > get_user_pages_fast... > > Yeah.. > > > But these patches look good to me (last time we discussed them I thought > > there was a race with page truncate, but it looks like you've closed that > > by holding page lock over the whole operation...) > > Just to be sure, I only hold the page lock over the get_futex_key() op, > and drop it after getting a ref on the futex key. > > I then drop the futex key ref after the futex op is complete. > > This assumes the futex key ref is suffucient to guarantee whatever is > needed - which is the point I'm still not quite sure about myself. > > The futex key ref was used between futex ops, with I assume the intent > to ensure the futex backing stays valid. However, the key ref only takes > a ref on either the inode or the mm, neither which avoid the specific > address of the futex to get unmapped between ops. > > So in that respect we're not worse off than before, and any application > doing: futex_wait(), munmap(), futex_wake() is going to suffer. And as > far as I understand it get the waiting task stuck in D state for > ever-more or somesuch. > > By now not holding the mmap_sem over the full futex op, but only over > the get_futex_key(), that munmap() race gets larger and the actual futex > could disappear while we're working on it, but in all cases I looked at > that will make the futex op return -EFAULT, so we should be good there. > > Gah, now that I look at it, it looks like I made get_futex_key() > asymetric wrt private futexes, they don't take a ref on the key, but > then do drop one... ouch.. Patch below. > > > Nice work, Peter. > > Thanks! > > > BTW. what kinds of things use inter-process futexes as of now? > > On a regular modern Linux system, not much. But I've been told there are > applications out there that do indeed make heavy use of them - as > they're part of POSIX etc.. blah blah :-) > > Also some legacy stuff that's stuck on an ancient glibc (but somehow did > manage to upgrade the kernel) might benefit. > > > --- > Subject: futex: fixup get_futex_key() for private futexes > From: Peter Zijlstra <a.p.zijlstra@chello.nl> > > With the get_user_pages_fast() patches we made get_futex_key() obtain a > reference on the returned key, but failed to do so for private futexes. > > Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
applied to tip/core/futexes, thanks Peter! Ingo --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/4] futex: get_user_pages_fast() for shared futexes
, Peter Zijlstra
, (Fri Sep 26, 10:32 am)
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared fu ...
, Ingo Molnar
, (Sat Sep 27, 9:17 am)
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared fu ...
, Nick Piggin
, (Tue Sep 30, 12:21 am)
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared fu ...
, Peter Zijlstra
, (Tue Sep 30, 1:51 am)
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared fu ...
, Ingo Molnar
, (Tue Sep 30, 3:39 am)
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared fu ...
, Ingo Molnar
, (Tue Sep 30, 3:39 am)
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared fu ...
, Nick Piggin
, (Tue Sep 30, 3:42 am)
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared fu ...
, Eric Dumazet
, (Tue Sep 30, 3:55 am)
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared fu ...
, Peter Zijlstra
, (Tue Sep 30, 4:16 am)
Re: [PATCH 0/4] futex: get_user_pages_fast() for shared fu ...
, Ulrich Drepper
, (Tue Sep 30, 8:13 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ingo Molnar
Re: [PATCH 0/3] v2 Make hierarchical RCU less IPI-happy and add more tracing
Jeremy Fitzhardinge
Re: Linux 2.6.28.10 and Linux 2.6.29.6 XEN Guest Support Broken x86_64 in BUILD
Nick Piggin
Re: [patch] CFS (Completely Fair Scheduler), v2
Gary Hade
Re: [PATCH 0/5][RFC] Physical PCI slot objects
Dave Johnson
Re: expected behavior of PF_PACKET on NETIF_F_HW_VLAN_RX device?
linux-netdev
:
Arnd Bergmann
Re: 64-bit net_device_stats
Stephens, Allan
RE: [PATCH]: tipc: Fix oops on send prior to entering networked mode
frank.blaschka
[patch 3/5] [PATCH] qeth: support z/VM VSWITCH Port Isolation
Wu Fengguang
Re: [PATCH] dm9601: handle corrupt mac address
David Miller
Re: [PATCH net-2.6.24] Fix refcounting problem with netif_rx_reschedule()
git
:
Junio C Hamano
Re: [PATCH] [RFC] add Message-ID field to log on git-am operation
Junio C Hamano
Re: Handling large files with GIT
Karl
Re: [ANNOUNCE] pg - A patch porcelain for GIT
Josh Triplett
Re: [RFC][PATCH 00/10] Sparse: Git's "make check" target
Pierre Habouzit
Re: [PATCH] git-daemon: more powerful base-path/user-path settings, using formats.
git-commits-head
:
Linux Kernel Mailing List
MIPS: RBTX4939: Fix IOC pin-enable register updating
Linux Kernel Mailing List
regulator: update email address for Liam Girdwood
Linux Kernel Mailing List
[SCSI] ipr: add message to error table
Linux Kernel Mailing List
powerpc/32: Wire up the trampoline code for kdump
Linux Kernel Mailing List
USB: omap_udc: sync with OMAP tree
openbsd-misc
:
Josh Grosse
Re: error : pkg add phpMyAdmin
Brian Candler
Re: OBSD's perspective on SELinux
Jacob Meuser
Re: /dev/audio: Device busy
David Vasek
Re: Inexpensive, low power, "wall wart" computer
William Boshuck
Re: Richard Stallman...
Colocation donated by:
Syndicate