public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Userspace RCU 0.2.3
@ 2009-10-14 22:36 Mathieu Desnoyers
  2009-10-15  0:02 ` Paul E. McKenney
  0 siblings, 1 reply; 11+ messages in thread
From: Mathieu Desnoyers @ 2009-10-14 22:36 UTC (permalink / raw)
  To: Josh Triplett, Jon Bernard, Jan Blunck, Paul E. McKenney,
	Pierre Habouzit, Steven Munroe, Bert Wesarg, Pierre-Marc Fournier
  Cc: ltt-dev, rp, linux-kernel

Hi,

I just released lib urcu 0.2.3, which is now using autotools. I also
integrated automatic architecture detection for old 386 which lack
cmpxchg (using a fall-back if necessary). I also use a lock; addl
instead of mfence on x86-32 to support a larger variety of older Intel
CPUs.

The build system detects if NR_futex is available in the system
headers. It falls back on a more portable alternative if they are not
available.

There are also new configuration modes to ./configure for UP-only
systems.

As always, the tarballs are available at http://www.lttng.org/urcu

Mathieu

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

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

* Re: Userspace RCU 0.2.3
  2009-10-14 22:36 Userspace RCU 0.2.3 Mathieu Desnoyers
@ 2009-10-15  0:02 ` Paul E. McKenney
  2009-10-15  2:39   ` Mathieu Desnoyers
  0 siblings, 1 reply; 11+ messages in thread
From: Paul E. McKenney @ 2009-10-15  0:02 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: Josh Triplett, Jon Bernard, Jan Blunck, Pierre Habouzit,
	Steven Munroe, Bert Wesarg, Pierre-Marc Fournier, ltt-dev, rp,
	linux-kernel

On Wed, Oct 14, 2009 at 06:36:57PM -0400, Mathieu Desnoyers wrote:
> Hi,
> 
> I just released lib urcu 0.2.3, which is now using autotools. I also
> integrated automatic architecture detection for old 386 which lack
> cmpxchg (using a fall-back if necessary). I also use a lock; addl
> instead of mfence on x86-32 to support a larger variety of older Intel
> CPUs.

!!!

Is there anyone on these lists other than me who has actually used an
SMP 80386-based system?

Either way, much appreciated for old time's sake.  The things we used
to do to avoid the need for cmpxchg!  ;-)

							Thanx, Paul

> The build system detects if NR_futex is available in the system
> headers. It falls back on a more portable alternative if they are not
> available.
> 
> There are also new configuration modes to ./configure for UP-only
> systems.
> 
> As always, the tarballs are available at http://www.lttng.org/urcu
> 
> Mathieu
> 
> -- 
> Mathieu Desnoyers
> OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

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

* Re: Userspace RCU 0.2.3
  2009-10-15  0:02 ` Paul E. McKenney
@ 2009-10-15  2:39   ` Mathieu Desnoyers
  2009-10-15  4:34     ` Paul E. McKenney
  2009-10-15  9:00     ` Josh Triplett
  0 siblings, 2 replies; 11+ messages in thread
From: Mathieu Desnoyers @ 2009-10-15  2:39 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Josh Triplett, Jon Bernard, Jan Blunck, Pierre Habouzit,
	Steven Munroe, Bert Wesarg, Pierre-Marc Fournier, ltt-dev, rp,
	linux-kernel

* Paul E. McKenney (paulmck@linux.vnet.ibm.com) wrote:
> On Wed, Oct 14, 2009 at 06:36:57PM -0400, Mathieu Desnoyers wrote:
> > Hi,
> > 
> > I just released lib urcu 0.2.3, which is now using autotools. I also
> > integrated automatic architecture detection for old 386 which lack
> > cmpxchg (using a fall-back if necessary). I also use a lock; addl
> > instead of mfence on x86-32 to support a larger variety of older Intel
> > CPUs.
> 
> !!!
> 
> Is there anyone on these lists other than me who has actually used an
> SMP 80386-based system?

SMP 386, ugh, no. But UP 386 yes (at least me). :)

It will become important as the library gets integrated in
distributions.

> 
> Either way, much appreciated for old time's sake.  The things we used
> to do to avoid the need for cmpxchg!  ;-)

In this case I disable signals and take a mutex around the cmpxchg. It's
really a best effort. Should be fine on UP 386, but not so much on SMP
386, as mixing it with assign/xchg pointer could lead to races. I'm not
sure it's worth trying to support 386 SMP though.

Mathieu


> 
> 							Thanx, Paul
> 
> > The build system detects if NR_futex is available in the system
> > headers. It falls back on a more portable alternative if they are not
> > available.
> > 
> > There are also new configuration modes to ./configure for UP-only
> > systems.
> > 
> > As always, the tarballs are available at http://www.lttng.org/urcu
> > 
> > Mathieu
> > 
> > -- 
> > Mathieu Desnoyers
> > OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

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

* Re: Userspace RCU 0.2.3
  2009-10-15  2:39   ` Mathieu Desnoyers
@ 2009-10-15  4:34     ` Paul E. McKenney
  2009-10-15  9:00     ` Josh Triplett
  1 sibling, 0 replies; 11+ messages in thread
From: Paul E. McKenney @ 2009-10-15  4:34 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: Josh Triplett, Jon Bernard, Jan Blunck, Pierre Habouzit,
	Steven Munroe, Bert Wesarg, Pierre-Marc Fournier, ltt-dev, rp,
	linux-kernel

On Wed, Oct 14, 2009 at 10:39:25PM -0400, Mathieu Desnoyers wrote:
> * Paul E. McKenney (paulmck@linux.vnet.ibm.com) wrote:
> > On Wed, Oct 14, 2009 at 06:36:57PM -0400, Mathieu Desnoyers wrote:
> > > Hi,
> > > 
> > > I just released lib urcu 0.2.3, which is now using autotools. I also
> > > integrated automatic architecture detection for old 386 which lack
> > > cmpxchg (using a fall-back if necessary). I also use a lock; addl
> > > instead of mfence on x86-32 to support a larger variety of older Intel
> > > CPUs.
> > 
> > !!!
> > 
> > Is there anyone on these lists other than me who has actually used an
> > SMP 80386-based system?
> 
> SMP 386, ugh, no. But UP 386 yes (at least me). :)
> 
> It will become important as the library gets integrated in
> distributions.
> 
> > Either way, much appreciated for old time's sake.  The things we used
> > to do to avoid the need for cmpxchg!  ;-)
> 
> In this case I disable signals and take a mutex around the cmpxchg. It's
> really a best effort. Should be fine on UP 386, but not so much on SMP
> 386, as mixing it with assign/xchg pointer could lead to races. I'm not
> sure it's worth trying to support 386 SMP though.

Definitely not worth much, if anything, to support 386 SMP.

							Thanx, Paul

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

* Re: Userspace RCU 0.2.3
  2009-10-15  2:39   ` Mathieu Desnoyers
  2009-10-15  4:34     ` Paul E. McKenney
@ 2009-10-15  9:00     ` Josh Triplett
  2009-10-15 17:40       ` Pierre-Marc Fournier
  1 sibling, 1 reply; 11+ messages in thread
From: Josh Triplett @ 2009-10-15  9:00 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: Paul E. McKenney, Jon Bernard, Jan Blunck, Pierre Habouzit,
	Steven Munroe, Bert Wesarg, Pierre-Marc Fournier, ltt-dev, rp,
	linux-kernel

On Wed, Oct 14, 2009 at 10:39:25PM -0400, Mathieu Desnoyers wrote:
> * Paul E. McKenney (paulmck@linux.vnet.ibm.com) wrote:
> > On Wed, Oct 14, 2009 at 06:36:57PM -0400, Mathieu Desnoyers wrote:
> > > Hi,
> > > 
> > > I just released lib urcu 0.2.3, which is now using autotools. I also
> > > integrated automatic architecture detection for old 386 which lack
> > > cmpxchg (using a fall-back if necessary). I also use a lock; addl
> > > instead of mfence on x86-32 to support a larger variety of older Intel
> > > CPUs.
> > 
> > !!!
> > 
> > Is there anyone on these lists other than me who has actually used an
> > SMP 80386-based system?
> 
> SMP 386, ugh, no. But UP 386 yes (at least me). :)
> 
> It will become important as the library gets integrated in
> distributions.

Even Debian has given up on real 386 systems at this point, primarily
because system libraries like glibc have; 486 and better represents the
bare minimum required at this point.  I don't know of any distributions
supporting real 386 systems at this point, and doing so would represent
a major undertaking.

- Josh Triplett

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

* Re: Userspace RCU 0.2.3
  2009-10-15  9:00     ` Josh Triplett
@ 2009-10-15 17:40       ` Pierre-Marc Fournier
  2009-10-17 17:16         ` Pavel Machek
  0 siblings, 1 reply; 11+ messages in thread
From: Pierre-Marc Fournier @ 2009-10-15 17:40 UTC (permalink / raw)
  To: Josh Triplett
  Cc: Mathieu Desnoyers, Paul E. McKenney, Jon Bernard, Jan Blunck,
	Pierre Habouzit, Steven Munroe, Bert Wesarg, ltt-dev, rp,
	linux-kernel

Josh Triplett wrote:
> 
> Even Debian has given up on real 386 systems at this point, primarily
> because system libraries like glibc have; 486 and better represents the
> bare minimum required at this point.  I don't know of any distributions
> supporting real 386 systems at this point, and doing so would represent
> a major undertaking.
> 

What about embedded systems? Anyone know if some 386 chips, perhaps even
in smp configurations, are still in use in those?

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

* Re: Userspace RCU 0.2.3
  2009-10-15 17:40       ` Pierre-Marc Fournier
@ 2009-10-17 17:16         ` Pavel Machek
  2009-10-18 22:02           ` [rp] " Mathieu Desnoyers
  0 siblings, 1 reply; 11+ messages in thread
From: Pavel Machek @ 2009-10-17 17:16 UTC (permalink / raw)
  To: Pierre-Marc Fournier
  Cc: Josh Triplett, Mathieu Desnoyers, Paul E. McKenney, Jon Bernard,
	Jan Blunck, Pierre Habouzit, Steven Munroe, Bert Wesarg, ltt-dev,
	rp, linux-kernel

On Thu 2009-10-15 13:40:54, Pierre-Marc Fournier wrote:
> Josh Triplett wrote:
> > 
> > Even Debian has given up on real 386 systems at this point, primarily
> > because system libraries like glibc have; 486 and better represents the
> > bare minimum required at this point.  I don't know of any distributions
> > supporting real 386 systems at this point, and doing so would represent
> > a major undertaking.
> > 
> 
> What about embedded systems? Anyone know if some 386 chips, perhaps even
> in smp configurations, are still in use in those?

smp 386: definitely not.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [rp] Userspace RCU 0.2.3
  2009-10-17 17:16         ` Pavel Machek
@ 2009-10-18 22:02           ` Mathieu Desnoyers
  2009-10-18 22:52             ` Pavel Machek
  0 siblings, 1 reply; 11+ messages in thread
From: Mathieu Desnoyers @ 2009-10-18 22:02 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Pierre-Marc Fournier, Jan Blunck, Steven Munroe, rp,
	Josh Triplett, linux-kernel, ltt-dev, Pierre Habouzit,
	Jon Bernard, Paul E. McKenney, Bert Wesarg

* Pavel Machek (pavel@ucw.cz) wrote:
> On Thu 2009-10-15 13:40:54, Pierre-Marc Fournier wrote:
> > Josh Triplett wrote:
> > > 
> > > Even Debian has given up on real 386 systems at this point, primarily
> > > because system libraries like glibc have; 486 and better represents the
> > > bare minimum required at this point.  I don't know of any distributions
> > > supporting real 386 systems at this point, and doing so would represent
> > > a major undertaking.
> > > 
> > 
> > What about embedded systems? Anyone know if some 386 chips, perhaps even
> > in smp configurations, are still in use in those?
> 
> smp 386: definitely not.

Hrm, so for UP 386, I wonder what's the best approach.

One would be to encapsulate all write accesses to the RCU pointers. If
we detect that the architecture lacks cmpxchg, _all_ update operations
(rcu_assign_pointer, rcu_xchg_pointer and rcu_cmpxchg_pointer) would
have to use the signal-disabled+mutex fall-back.

Does it make sense ?

Mathieu

> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
> 
> _______________________________________________
> rp mailing list
> rp@svcs.cs.pdx.edu
> http://svcs.cs.pdx.edu/mailman/listinfo/rp

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

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

* Re: [rp] Userspace RCU 0.2.3
  2009-10-18 22:02           ` [rp] " Mathieu Desnoyers
@ 2009-10-18 22:52             ` Pavel Machek
  2009-10-18 23:16               ` [ltt-dev] " Mathieu Desnoyers
  2009-10-19 23:59               ` Userspace RCU 0.2.4 Mathieu Desnoyers
  0 siblings, 2 replies; 11+ messages in thread
From: Pavel Machek @ 2009-10-18 22:52 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: Pierre-Marc Fournier, Jan Blunck, Steven Munroe, rp,
	Josh Triplett, linux-kernel, ltt-dev, Pierre Habouzit,
	Jon Bernard, Paul E. McKenney, Bert Wesarg

On Sun 2009-10-18 18:02:43, Mathieu Desnoyers wrote:
> * Pavel Machek (pavel@ucw.cz) wrote:
> > On Thu 2009-10-15 13:40:54, Pierre-Marc Fournier wrote:
> > > Josh Triplett wrote:
> > > > 
> > > > Even Debian has given up on real 386 systems at this point, primarily
> > > > because system libraries like glibc have; 486 and better represents the
> > > > bare minimum required at this point.  I don't know of any distributions
> > > > supporting real 386 systems at this point, and doing so would represent
> > > > a major undertaking.
> > > > 
> > > 
> > > What about embedded systems? Anyone know if some 386 chips, perhaps even
> > > in smp configurations, are still in use in those?
> > 
> > smp 386: definitely not.
> 
> Hrm, so for UP 386, I wonder what's the best approach.
> 
> One would be to encapsulate all write accesses to the RCU pointers. If
> we detect that the architecture lacks cmpxchg, _all_ update operations
> (rcu_assign_pointer, rcu_xchg_pointer and rcu_cmpxchg_pointer) would
> have to use the signal-disabled+mutex fall-back.
> 
> Does it make sense ?

Yep, but it sounds expensive. Another option is to ignore the issue
and see how many people still have 386s :-). Few  embedded  systems
may be affected, but...

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [ltt-dev] [rp] Userspace RCU 0.2.3
  2009-10-18 22:52             ` Pavel Machek
@ 2009-10-18 23:16               ` Mathieu Desnoyers
  2009-10-19 23:59               ` Userspace RCU 0.2.4 Mathieu Desnoyers
  1 sibling, 0 replies; 11+ messages in thread
From: Mathieu Desnoyers @ 2009-10-18 23:16 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Pierre Habouzit, Steven Munroe, rp, linux-kernel, Josh Triplett,
	ltt-dev, Jon Bernard, Paul E. McKenney, Jan Blunck

* Pavel Machek (pavel@ucw.cz) wrote:
> On Sun 2009-10-18 18:02:43, Mathieu Desnoyers wrote:
> > * Pavel Machek (pavel@ucw.cz) wrote:
> > > On Thu 2009-10-15 13:40:54, Pierre-Marc Fournier wrote:
> > > > Josh Triplett wrote:
> > > > > 
> > > > > Even Debian has given up on real 386 systems at this point, primarily
> > > > > because system libraries like glibc have; 486 and better represents the
> > > > > bare minimum required at this point.  I don't know of any distributions
> > > > > supporting real 386 systems at this point, and doing so would represent
> > > > > a major undertaking.
> > > > > 
> > > > 
> > > > What about embedded systems? Anyone know if some 386 chips, perhaps even
> > > > in smp configurations, are still in use in those?
> > > 
> > > smp 386: definitely not.
> > 
> > Hrm, so for UP 386, I wonder what's the best approach.
> > 
> > One would be to encapsulate all write accesses to the RCU pointers. If
> > we detect that the architecture lacks cmpxchg, _all_ update operations
> > (rcu_assign_pointer, rcu_xchg_pointer and rcu_cmpxchg_pointer) would
> > have to use the signal-disabled+mutex fall-back.
> > 
> > Does it make sense ?
> 
> Yep, but it sounds expensive. Another option is to ignore the issue
> and see how many people still have 386s :-). Few  embedded  systems
> may be affected, but...
> 

I can keep that as a special build option, e.g.

target: i386

Mathieu

> 									Pavel
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev@lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

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

* Userspace RCU 0.2.4
  2009-10-18 22:52             ` Pavel Machek
  2009-10-18 23:16               ` [ltt-dev] " Mathieu Desnoyers
@ 2009-10-19 23:59               ` Mathieu Desnoyers
  1 sibling, 0 replies; 11+ messages in thread
From: Mathieu Desnoyers @ 2009-10-19 23:59 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Pierre Habouzit, Steven Munroe, rp, linux-kernel, Josh Triplett,
	ltt-dev, Jon Bernard, Paul E. McKenney, Jan Blunck

* Pavel Machek (pavel@ucw.cz) wrote:
> On Sun 2009-10-18 18:02:43, Mathieu Desnoyers wrote:
> > * Pavel Machek (pavel@ucw.cz) wrote:
> > > On Thu 2009-10-15 13:40:54, Pierre-Marc Fournier wrote:
> > > > Josh Triplett wrote:
> > > > > 
> > > > > Even Debian has given up on real 386 systems at this point, primarily
> > > > > because system libraries like glibc have; 486 and better represents the
> > > > > bare minimum required at this point.  I don't know of any distributions
> > > > > supporting real 386 systems at this point, and doing so would represent
> > > > > a major undertaking.
> > > > > 
> > > > 
> > > > What about embedded systems? Anyone know if some 386 chips, perhaps even
> > > > in smp configurations, are still in use in those?
> > > 
> > > smp 386: definitely not.
> > 
> > Hrm, so for UP 386, I wonder what's the best approach.
> > 
> > One would be to encapsulate all write accesses to the RCU pointers. If
> > we detect that the architecture lacks cmpxchg, _all_ update operations
> > (rcu_assign_pointer, rcu_xchg_pointer and rcu_cmpxchg_pointer) would
> > have to use the signal-disabled+mutex fall-back.
> > 
> > Does it make sense ?
> 
> Yep, but it sounds expensive. Another option is to ignore the issue
> and see how many people still have 386s :-). Few  embedded  systems
> may be affected, but...

Well.. I just enhanced liburcu to fully support 386 SMP (even if
opinions seems to vary regarding its usefulness...) ;) It adds _no_
overhead whatsoever if building for i486+ or x86 64.

What I did is a complete "compatibility mode" for all uatomic_arch_x86.h
atomic operations (it's my own user-space reimplementation of the Linux
kernel atomic.h). It's in liburcu 0.2.4 (now released).

How it works:

config x86 64 or x86 32 > i386 :

#define to map directly to atomic operations.

config i386 :

dynamically detect the cpu id, caches it in "cas_avail" variable.
If cas_avail is -1 (unset) -> dynamically check, cache result.
If cas_avail is 1 -> use atomic operations.
If cas_avail is 0 -> use compatibility mode for _all_ uatomic
  write operations involving signal disabling and a mutex. Only
  uatomic_read is exempt from locking.

So it should be safe to access RCU pointers through the
rcu_cmpxchg/xchg/set/assign_pointer() and rcu_dereference() primitives.

I tried to force using the compatibility mode by changing the condition
in compat_arch_x86.c and building for i386 compatibility. It works fine
and passes the test_uatomic test cases. Passes the rcutorture test too.

Mathieu

> 
> 									Pavel
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev@lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

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

end of thread, other threads:[~2009-10-19 23:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-14 22:36 Userspace RCU 0.2.3 Mathieu Desnoyers
2009-10-15  0:02 ` Paul E. McKenney
2009-10-15  2:39   ` Mathieu Desnoyers
2009-10-15  4:34     ` Paul E. McKenney
2009-10-15  9:00     ` Josh Triplett
2009-10-15 17:40       ` Pierre-Marc Fournier
2009-10-17 17:16         ` Pavel Machek
2009-10-18 22:02           ` [rp] " Mathieu Desnoyers
2009-10-18 22:52             ` Pavel Machek
2009-10-18 23:16               ` [ltt-dev] " Mathieu Desnoyers
2009-10-19 23:59               ` Userspace RCU 0.2.4 Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox