HomeClusterLabs Projects

API: libcrmcommon: deprecate __builtin_expect(), __likely(), and __unlikely()

Description

API: libcrmcommon: deprecate builtin_expect(), likely(), and __unlikely()

Pacemaker's public API should be Pacemaker-specific, and not provide
general-purpose features like compiler hinting macros. (The naming suggests
these were intended to be internal to begin with, anyway.)

The use of these internally has been removed, since everything I've read
suggests that these gcc-specific hints have no benefit in most cases. Modern
CPUs' run-time dynamic branch prediction is generally better than a compiler's
even with hints, and when the compiler is better it's generally by nanoseconds.

Details

Provenance
kgaillotAuthored on Mar 16 2021, 6:57 PM
Parents
rPc8394a9dbb96: Merge pull request #2329 from clumens/glistptr
Branches
Unknown
Tags
Unknown

Event Timeline