Project

General

Profile

Actions

Bug #14752

closed

AVL: Remove obsolete branching optimizations

Added by Toomas Soome 16 days ago. Updated 8 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Update from OpenZFS (commit fc5200aa9b345972fc1b99869b03a373090b84c7)

    Modern Clang and GCC can successfully implement simple conditions
    without branching with math and flag operations.  Use of arrays for
    translation no longer helps as much as it was 14+ years ago.

    Disassemble of the code generated by Clang 13.0.0 on FreeBSD 13.1,
    Clang 14.0.4 on FreeBSD 14 and GCC 10.2.1 on Debian 11 with this
    change still shows no branching instructions.

    Profiling of CPU-bound scan stage of sorted scrub shows reproducible
    reduction of time spent inside avl_find() from 6.52% to 4.58%.

    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Alexander Motin <mav@FreeBSD.org>
    Sponsored-By: iXsystems, Inc.
    Closes #13540

Testing done: bjuild/install/boot, running zpool scrub with this update applied.

Actions #1

Updated by Electric Monk 16 days ago

  • Gerrit CR set to 2193
Actions #2

Updated by Toomas Soome 15 days ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk 8 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 028c45646327b08802a29b76d1abea8907a57f17

commit  028c45646327b08802a29b76d1abea8907a57f17
Author: Alexander Motin <mav@FreeBSD.org>
Date:   2022-06-28T17:01:03.000Z

    14752 AVL: Remove obsolete branching optimizations
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@mnx.io>

Actions

Also available in: Atom PDF