freebsd-skq/sys
Matt Macy 648cfe57fd Performance optimization of AVL tree comparator functions
MFV:
commit ee36c709c3d5f7040e1bd11f5c75318aa03e789f
Author: Gvozden Neskovic <neskovic@gmail.com>
Date:   Sat Aug 27 20:12:53 2016 +0200

    perf: 2.75x faster ddt_entry_compare()
        First 256bits of ddt_key_t is a block checksum, which are expected
    to be close to random data. Hence, on average, comparison only needs to
    look at first few bytes of the keys. To reduce number of conditional
    jump instructions, the result is computed as: sign(memcmp(k1, k2)).

    Sign of an integer 'a' can be obtained as: `(0 < a) - (a < 0)` := {-1, 0, 1} ,
    which is computed efficiently.  Synthetic performance evaluation of
    original and new algorithm over 1G random keys on 2.6GHz Intel(R) Xeon(R)
    CPU E5-2660 v3:

    old     6.85789 s
    new     2.49089 s

    perf: 2.8x faster vdev_queue_offset_compare() and vdev_queue_timestamp_compare()
        Compute the result directly instead of using conditionals

    perf: zfs_range_compare()
        Speedup between 1.1x - 2.5x, depending on compiler version and
    optimization level.

    perf: spa_error_entry_compare()
        `bcmp()` is not suitable for comparator use. Use `memcmp()` instead.

    perf: 2.8x faster metaslab_compare() and metaslab_rangesize_compare()
    perf: 2.8x faster zil_bp_compare()
    perf: 2.8x faster mze_compare()
    perf: faster dbuf_compare()
    perf: faster compares in spa_misc
    perf: 2.8x faster layout_hash_compare()
    perf: 2.8x faster space_reftree_compare()
    perf: libzfs: faster avl tree comparators
    perf: guid_compare()
    perf: dsl_deadlist_compare()
    perf: perm_set_compare()
    perf: 2x faster range_tree_seg_compare()
    perf: faster unique_compare()
    perf: faster vdev_cache _compare()
    perf: faster vdev_uberblock_compare()
    perf: faster fuid _compare()
    perf: faster zfs_znode_hold_compare()

    Signed-off-by: Gvozden Neskovic <neskovic@gmail.com>
    Signed-off-by: Richard Elling <richard.elling@gmail.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes #5033
2018-08-10 06:42:08 +00:00
..
amd64 Futex support functions in linux.ko and linux32.ko on amd64 should be 2018-08-07 18:29:10 +00:00
arm Add support for pmap_enter(..., psind=1) to the armv6 pmap. In other words, 2018-08-08 16:55:01 +00:00
arm64 efirt: Don't enter EFI context early, convert addrs to KVA instead 2018-08-04 21:41:10 +00:00
bsm
cam cam(4): Add an xpt-neutral flag indicating a valid panic CCB 2018-08-09 21:53:32 +00:00
cddl Performance optimization of AVL tree comparator functions 2018-08-10 06:42:08 +00:00
compat Use atomic_fcmpset_XXX() instead of atomic_cmpset_XXX() when possible 2018-08-09 09:39:32 +00:00
conf Rename head from -CURRENT to -ALPHA1 as part of the 2018-08-10 00:01:21 +00:00
contrib Correct a comment. Should have been detected by ipf_nat_in() not 2018-08-10 00:30:15 +00:00
crypto libmd: Always erase context in _Final method, and when doing 2018-07-20 07:01:28 +00:00
ddb add an option for ddb ps command to print process arguments 2018-08-09 11:21:31 +00:00
dev cxgbe(4): Add a sysctl to control the tx credit reclaim mechanism for 2018-08-09 21:52:51 +00:00
dts Remove Atmel AT91RM9200 and AT91SAM9 support. 2018-07-27 18:28:22 +00:00
fs Assorted fixes to handling of LayoutRecall callbacks, mostly error handling. 2018-08-08 20:21:45 +00:00
gdb
geom OpenCrypto: Convert sessions to opaque handles instead of integers 2018-07-18 00:56:25 +00:00
gnu
i386 Implement missing atomic_fcmpset_XXX() support for i386. 2018-08-09 11:30:13 +00:00
isa
kern subr_prf: style(9) the sizeof 2018-08-09 19:09:06 +00:00
kgssapi OpenCrypto: Convert sessions to opaque handles instead of integers 2018-07-18 00:56:25 +00:00
libkern
mips Add pmap_is_valid_memattr(9). 2018-08-01 18:45:51 +00:00
modules uep(4): add evdev support 2018-08-05 11:14:13 +00:00
net pf: Increase default hash table size 2018-08-05 13:54:37 +00:00
net80211 net80211: Fix ifdetach w/o ifattach, small whitespace cleanup 2018-07-10 23:30:19 +00:00
netgraph Use if_tunnel_check_nesting() for ng_iface(4). 2018-08-03 22:55:58 +00:00
netinet [ppc] Fix kernel panic when using BOOTP_NFSROOT 2018-08-09 14:04:51 +00:00
netinet6 [ppc] Fix kernel panic when using BOOTP_NFSROOT 2018-08-09 14:04:51 +00:00
netipsec Use the new VNET_DEFINE_STATIC macro when we are defining static VNET 2018-07-24 16:35:52 +00:00
netpfil Use host byte order when comparing mss values. 2018-08-08 17:32:02 +00:00
netsmb Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
nfs
nfsclient
nfsserver
nlm
ofed Only NULL check the VNET pointer when VIMAGE is enabled in ibcore. 2018-07-31 11:23:44 +00:00
opencrypto Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
powerpc powerpc: Add lwsync and ptesync 'sync' opcode variants to ddb disassembler 2018-08-10 03:28:40 +00:00
riscv Implement uma_small_alloc(), uma_small_free(). 2018-08-08 16:08:38 +00:00
rpc Set SO_SNDTIMEO in the client side krpc when CLSET_TIMEOUT is done. 2018-07-20 12:03:16 +00:00
security Require that MAC label buffers be able to store a non-empty string. 2018-08-01 03:46:07 +00:00
sparc64 Add pmap_is_valid_memattr(9). 2018-08-01 18:45:51 +00:00
sys BOOT_TAG: Make a config(5) option, expose as sysctl and loader tunable 2018-08-09 17:47:47 +00:00
teken
tests epoch_test: fix compile 2018-07-15 00:31:17 +00:00
tools
ufs Put in place the framework for consolodating contiguous blocks into 2018-08-06 21:09:11 +00:00
vm Account for the lowmem handlers in the inactive queue scan target. 2018-08-09 18:25:49 +00:00
x86 Verify that each frame pointer lies within the thread's kstack. 2018-08-03 02:51:37 +00:00
xdr
xen xen: add missing file from r336474 2018-07-19 10:14:52 +00:00
Makefile