[Bugs] [Bug 1437037] Standardize atomic increment/decrement calling conventions
bugzilla at redhat.com
bugzilla at redhat.com
Wed Apr 5 13:14:29 UTC 2017
https://bugzilla.redhat.com/show_bug.cgi?id=1437037
--- Comment #7 from Worker Ant <bugzilla-bot at gluster.org> ---
COMMIT: https://review.gluster.org/16963 committed in master by Jeff Darcy
(jeff at pl.atyp.us)
------
commit 93e3c9abce1a02ac724afa382751852fa5edf713
Author: Niels de Vos <ndevos at redhat.com>
Date: Wed Mar 29 13:44:03 2017 +0200
libglusterfs: provide standardized atomic operations
The current macros ATOMIC_INCREMENT() and ATOMIC_DECREMENT() expect a
lock as first argument. There are at least two issues with this
approach:
1. this lock is unused on architectures that have atomic operations
2. some structures use a single lock for multiple variables
By defining a gf_atomic_t type, the unused lock can be removed, saving a
few bytes on modern architectures.
Because the gf_atomic_t type locates the lock for the variable (in case
of older architectures), each variable is protected the same on all
architectures. This makes the behaviour across all architectures more
equal (per variable locking, by a gf_lock_t or compiler optimization).
BUG: 1437037
Change-Id: Ic164892b06ea676e6a9566f8a98b7faf0efe76d6
Signed-off-by: Niels de Vos <ndevos at redhat.com>
Reviewed-on: https://review.gluster.org/16963
Smoke: Gluster Build System <jenkins at build.gluster.org>
Reviewed-by: Xavier Hernandez <xhernandez at datalab.es>
NetBSD-regression: NetBSD Build System <jenkins at build.gluster.org>
CentOS-regression: Gluster Build System <jenkins at build.gluster.org>
Reviewed-by: Amar Tumballi <amarts at redhat.com>
Reviewed-by: Jeff Darcy <jeff at pl.atyp.us>
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=kUIXNr5a19&a=cc_unsubscribe
More information about the Bugs
mailing list