linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* questions about native alpha futex implementation
@ 2008-12-17 19:13 Matt Turner
  2008-12-17 19:26 ` Roland Dreier
  2008-12-17 21:46 ` Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Turner @ 2008-12-17 19:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ivan Kokshaysky, rth, Jay Estabrook

Hi,

Alpha uses a generic futex implementation, which causes some problems [1].

I've read through the code, and it appears as if the implementation
could be done by using the ldq_l/stq_c instructions, relatively easy I
might add. I'm definitely interested in implementing this, but first...

I have only a few questions.

1) What are the benefits of a native futex implementation, other than
fixing the glibc test failures?
2) Is there a technical reason it hasn't been implemented on Alpha?
3) Am in correct that it could be done with ldq_l/stq_c instructions?

I'm not experienced with kernel development, but I'd like to learn, so
please bear with me.

Thanks,

Matt Turner

[1] http://bugs.gentoo.org/show_bug.cgi?id=205099

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: questions about native alpha futex implementation
  2008-12-17 19:13 questions about native alpha futex implementation Matt Turner
@ 2008-12-17 19:26 ` Roland Dreier
  2008-12-17 21:46 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Roland Dreier @ 2008-12-17 19:26 UTC (permalink / raw)
  To: Matt Turner; +Cc: linux-kernel, Ivan Kokshaysky, rth, Jay Estabrook

 > Alpha uses a generic futex implementation, which causes some problems [1].

Summarizing this: the generic futex implementation leaves
futex_atomic_cmpxchg_inatomic() as a stub that just returns -ENOSYS, and
glibc robust futex code can't handle this return value, which leads to
glibc tests hanging.

 > I've read through the code, and it appears as if the implementation
 > could be done by using the ldq_l/stq_c instructions, relatively easy I
 > might add. I'm definitely interested in implementing this, but first...
 > 
 > I have only a few questions.
 > 
 > 1) What are the benefits of a native futex implementation, other than
 > fixing the glibc test failures?

Presumably native implementations can use optimized assembly, which
would be somewhat faster than a generic implementation in C.

 > 2) Is there a technical reason it hasn't been implemented on Alpha?

I don't know for sure, but I would guess it's just that no one has cared
enough about optimizing futexes on alpha.

A native implementation for alpha is probably an amusing project, but
also figuring out a way of implementing the missing operations for
generic futexes would be nice too (given that glibc uses them now).
Although a generic futex_atomic_cmpxchg_inatomic() that works for SMP
might be tricky.

 - R.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: questions about native alpha futex implementation
  2008-12-17 19:13 questions about native alpha futex implementation Matt Turner
  2008-12-17 19:26 ` Roland Dreier
@ 2008-12-17 21:46 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2008-12-17 21:46 UTC (permalink / raw)
  To: Matt Turner; +Cc: linux-kernel, Ivan Kokshaysky, Jay Estabrook

Matt Turner wrote:
> Hi,
> 
> Alpha uses a generic futex implementation, which causes some problems [1].
> 
> I've read through the code, and it appears as if the implementation
> could be done by using the ldq_l/stq_c instructions, relatively easy I
> might add. I'm definitely interested in implementing this, but first...
> 
> I have only a few questions.
> 
> 1) What are the benefits of a native futex implementation, other than
> fixing the glibc test failures?
> 2) Is there a technical reason it hasn't been implemented on Alpha?
> 3) Am in correct that it could be done with ldq_l/stq_c instructions?

I think all the futex stuff is 32-bits wide, so ldl_l/stl_c.
You can pretty much just copy the powerpc version, as that
platform also uses load-locked/store-conditional operations.


r~

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-17 21:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-17 19:13 questions about native alpha futex implementation Matt Turner
2008-12-17 19:26 ` Roland Dreier
2008-12-17 21:46 ` Richard Henderson

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).