Kaleb S. KEITHLEY c92b8347ae contrib/timerwheel: probable bug on 32-bit, use __builtin_ffs()
Simply always defining BITS_PER_LONG as 64 seems like it's almost
certainly wrong on 32-bit platforms and could potentially result in
incorrect results.

fls and, e.g., __builtin_ffs() return the same answer for any given
input, making it seem like the name fls (find last set) is a misnomer
and ffs (find first set, starting from the lsb) is the more accurate
name.

Using __builtin_ffs() causes the compiler (in intel) to emit code
with the bsf (bit scan forward) insn, which is approx 3x faster than
the code in ffs(), at least on the machine I tried it on. (Even so,
it takes 10M+ iterations for the speed difference to be measurable.
Choosing the "faster" implementation seems like a no-brainer, even
if there may not be any significant gain by doing so.)

Change-Id: I1616dda1a5b76f208ba737a713877c1673131e33
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: https://review.gluster.org/17142
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
2017-05-01 16:05:56 +00:00
2010-03-12 04:09:34 -08:00
2011-07-18 17:24:14 +05:30
2017-04-30 21:45:49 +00:00
2014-09-16 02:30:36 -07:00

For information about contributing to GlusterFS, please follow Contributing to GlusterFS community.

GlusterFS does not follow the GitHub: Fork & pull workflow but use Gerrit for code review.

The development guidelines are detailed in Development Workflow.

The GlusterFS documentation can be found at our Read the Docs site.

For more info, please visit gluster.org.

Description
No description provided
Readme 86 MiB
Languages
C 86.6%
Shell 7.5%
Python 3.6%
Perl 0.7%
Makefile 0.4%
Other 0.9%