]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crush: don't normalize input of crush_ln iteratively
authorPiotr Dałek <git@predictor.org.pl>
Wed, 31 Aug 2016 15:24:31 +0000 (17:24 +0200)
committerPiotr Dałek <git@predictor.org.pl>
Wed, 31 Aug 2016 19:18:54 +0000 (21:18 +0200)
commit110de33ca497d94fc4737e5154d3fe781fa84a0a
tree1ea0983f4cf997ac39e53a664243fd5230452004
parent596a7dc463f57ddcb6f9bc8fb3c9f2e94dbfdafd
crush: don't normalize input of crush_ln iteratively

Use __builtin_clz() supported by GCC and Clang to figure out
how many bits we should shift instead of shifting by a bit
in a loop until the value gets normalized. Improves performance
of this function by up to 3x in worst-case scenario and overall
straw2 performance by ~10%.

Signed-off-by: Piotr Dałek <git@predictor.org.pl>
src/crush/mapper.c