* Re: [parisc-linux] Re: + parisc-add-ptr-compatpatch.patch added to -mm tree [not found] ` <20060222091356.GA27449@elte.hu> @ 2006-04-09 0:11 ` Kyle McMartin 2006-04-09 5:37 ` Ingo Molnar 0 siblings, 1 reply; 3+ messages in thread From: Kyle McMartin @ 2006-04-09 0:11 UTC (permalink / raw) To: Ingo Molnar; +Cc: Andrew Morton, parisc-linux [Sorry about how long it has taken to get to this... I bounced it to parisc-linux too, so hopefully someone else can comment as well.] On Wed, Feb 22, 2006 at 10:13:56AM +0100, Ingo Molnar wrote: > There's only one complication i can imagine on PARISC: truly atomic > futex_atomic_cmpxchg_inuser() is not possible in any sane way because > any spinlock based cmpxchg exposes itself to userspace locking up the > kernel - no good. [We could in theory do something about it by imposing > some sort of deadline on the maximum time the spinning-on-userspace-lock > can take - but i dont think it's worth the trouble.] > Due to a complete lack of useful atomic operations on parisc, the way I envisioned implementing the routines was serializing all futex ops on a kernel spinlock. Since it's a userspace address, we couldn't use an atomic hash unless we found the physical address behind it, so just one spinlock would do... Of course, I'm probably missing something critical here, though. Cheers, Kyle M. _______________________________________________ parisc-linux mailing list parisc-linux@lists.parisc-linux.org http://lists.parisc-linux.org/mailman/listinfo/parisc-linux ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [parisc-linux] Re: + parisc-add-ptr-compatpatch.patch added to -mm tree 2006-04-09 0:11 ` [parisc-linux] Re: + parisc-add-ptr-compatpatch.patch added to -mm tree Kyle McMartin @ 2006-04-09 5:37 ` Ingo Molnar 2006-04-09 14:09 ` Carlos O'Donell 0 siblings, 1 reply; 3+ messages in thread From: Ingo Molnar @ 2006-04-09 5:37 UTC (permalink / raw) To: Kyle McMartin; +Cc: Andrew Morton, parisc-linux * Kyle McMartin <kyle@mcmartin.ca> wrote: > [Sorry about how long it has taken to get to this... I bounced it to > parisc-linux too, so hopefully someone else can comment as well.] > > On Wed, Feb 22, 2006 at 10:13:56AM +0100, Ingo Molnar wrote: > > There's only one complication i can imagine on PARISC: truly atomic > > futex_atomic_cmpxchg_inuser() is not possible in any sane way because > > any spinlock based cmpxchg exposes itself to userspace locking up the > > kernel - no good. [We could in theory do something about it by imposing > > some sort of deadline on the maximum time the spinning-on-userspace-lock > > can take - but i dont think it's worth the trouble.] > > > > Due to a complete lack of useful atomic operations on parisc, the way > I envisioned implementing the routines was serializing all futex ops > on a kernel spinlock. Since it's a userspace address, we couldn't use > an atomic hash unless we found the physical address behind it, so just > one spinlock would do... Of course, I'm probably missing something > critical here, though. if userspace doesnt do atomic ops then the solution should be relatively easy: make glibc always call into the kernel, and then the kernel-level futex.h ops can be implemented in a lockless manner (i.e. not even a spinlock is needed) and you'll get (pretty scalable) futex functionality. The in-kernel futex hash-bucket spinlocks take care of locking. Ingo _______________________________________________ parisc-linux mailing list parisc-linux@lists.parisc-linux.org http://lists.parisc-linux.org/mailman/listinfo/parisc-linux ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [parisc-linux] Re: + parisc-add-ptr-compatpatch.patch added to -mm tree 2006-04-09 5:37 ` Ingo Molnar @ 2006-04-09 14:09 ` Carlos O'Donell 0 siblings, 0 replies; 3+ messages in thread From: Carlos O'Donell @ 2006-04-09 14:09 UTC (permalink / raw) To: Ingo Molnar; +Cc: Kyle McMartin, Andrew Morton, parisc-linux On 4/9/06, Ingo Molnar <mingo@elte.hu> wrote: > > Due to a complete lack of useful atomic operations on parisc, the way > > I envisioned implementing the routines was serializing all futex ops > > on a kernel spinlock. Since it's a userspace address, we couldn't use > > an atomic hash unless we found the physical address behind it, so just > > one spinlock would do... Of course, I'm probably missing something > > critical here, though. > > if userspace doesnt do atomic ops then the solution should be relatively > easy: make glibc always call into the kernel, and then the kernel-level > futex.h ops can be implemented in a lockless manner (i.e. not even a > spinlock is needed) and you'll get (pretty scalable) futex > functionality. The in-kernel futex hash-bucket spinlocks take care of > locking. HPPA has a light-weight kernel syscall that does atomic-compare-and-swap, and indeed this is what we use for our NPTL implementation. We can use that *or* call into the kernel for arbitration. The atomic-compare-and-swap also uses a hash-bucket of spinlocks on SMP systems. We hash on a virtual address so it scales nicely. Not forever though. Some analysis to see which is faster should be done. I think we will always win with the light-weight syscall. Cheers, Carlos. _______________________________________________ parisc-linux mailing list parisc-linux@lists.parisc-linux.org http://lists.parisc-linux.org/mailman/listinfo/parisc-linux ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-04-09 14:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200602220102.k1M12Jje015527@shell0.pdx.osdl.net>
[not found] ` <20060222010459.GE26809@quicksilver.road.mcmartin.ca>
[not found] ` <20060221172126.2db4adef.akpm@osdl.org>
[not found] ` <20060222091356.GA27449@elte.hu>
2006-04-09 0:11 ` [parisc-linux] Re: + parisc-add-ptr-compatpatch.patch added to -mm tree Kyle McMartin
2006-04-09 5:37 ` Ingo Molnar
2006-04-09 14:09 ` Carlos O'Donell
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.