Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dmu_objset: replace dnode_hash impl with cityhash4 #16483

Closed
wants to merge 3 commits into from

Commits on Sep 19, 2024

  1. dmu_objset: replace dnode_hash impl with cityhash4

    As mentioned in PR openzfs#16131, replacing CRC-based hash with cityhash4
    could slightly improve the performance by eliminating memory access.
    Replacing algorightm is safe since the hash result is not persisted.
    
    See: openzfs#16131
    
    Signed-off-by: Shengqi Chen <[email protected]>
    Harry-Chen committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    66a53bd View commit details
    Browse the repository at this point in the history
  2. zcommon: add specialized versions of cityhash4

    Specializing cityhash4 on 32-bit architectures can reduce the size
    of stack frames as well as instruction count. This is a tiny but
    useful optimization, since some callers invoke it frequently.
    
    When specializing into 1/2/3/4-arg versions, the stack usage
    (in bytes) on some 32-bit arches are listed as follows:
    
    - x86: 32, 32, 32, 40
    - arm-v7a: 20, 20, 28, 36
    - riscv: 0, 0, 0, 16
    - power: 16, 16, 16, 32
    - mipsel: 8, 8, 8, 24
    
    And each actual argument (even if passing 0) contributes evenly
    to the number of multiplication instructions generated:
    
    - x86: 9, 12, 15 ,18
    - arm-v7a: 6, 8, 10, 12
    - riscv / power: 12, 18, 20, 24
    - mipsel: 9, 12, 15, 19
    
    On 64-bit architectures, the tendencies are similar. But both stack
    sizes and instruction counts are significantly smaller thus negligible.
    
    See more discussion at openzfs#16483.
    
    Acked-by: Alexander Motin <[email protected]>
    Signed-off-by: Shengqi Chen <[email protected]>
    Harry-Chen committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    f14d9d6 View commit details
    Browse the repository at this point in the history
  3. cityhash: replace invocations with specialized versions when possible

    So that we can get actual benefit from last commit.
    
    See more discussion at openzfs#16483.
    
    Acked-by: Alexander Motin <[email protected]>
    Signed-off-by: Shengqi Chen <[email protected]>
    Harry-Chen committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    e958069 View commit details
    Browse the repository at this point in the history