[rtems commit] SMP: Optimize ticket lock implementation
Sebastian Huber
sebh at rtems.org
Fri Oct 2 06:06:32 UTC 2015
Module: rtems
Branch: master
Commit: ba1ed5240b2f8c724a8efa8f652a8ba391fc92dd
Changeset: http://git.rtems.org/rtems/commit/?id=ba1ed5240b2f8c724a8efa8f652a8ba391fc92dd
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Oct 2 07:59:24 2015 +0200
SMP: Optimize ticket lock implementation
This reverts the relevant part of commit
da06fe948c0878057e5f563ebd3dfe40c0f1b0d2. The acquire/release order is
superfluous for the next ticket increment. The mutual exclusion is
guaranteed by the acquire load from and release store to the next
serving atomic variable.
---
cpukit/score/include/rtems/score/smplock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpukit/score/include/rtems/score/smplock.h b/cpukit/score/include/rtems/score/smplock.h
index ccf6b59..f98f38a 100644
--- a/cpukit/score/include/rtems/score/smplock.h
+++ b/cpukit/score/include/rtems/score/smplock.h
@@ -277,7 +277,7 @@ static inline void _SMP_ticket_lock_Do_acquire(
#endif
my_ticket =
- _Atomic_Fetch_add_uint( &lock->next_ticket, 1U, ATOMIC_ORDER_ACQ_REL );
+ _Atomic_Fetch_add_uint( &lock->next_ticket, 1U, ATOMIC_ORDER_RELAXED );
#if defined( RTEMS_PROFILING )
now_serving =
More information about the vc
mailing list