mirror_zfs/lib
Shengqi Chen 0ae4460c61 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.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Closes #16131
Closes #16483
2024-09-19 15:18:59 -07:00
..
libavl cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libefi Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN. 2024-05-10 08:47:21 -07:00
libicp icp: remove skein module 2024-05-31 15:13:39 -07:00
libnvpair libspl: lift backtrace into a separate file 2024-05-14 09:48:45 -07:00
libshare Fix handling of DNS names with '-' in them for sharenfs 2024-09-17 13:56:26 -07:00
libspl Adding Direct IO Support 2024-09-14 13:47:59 -07:00
libtpool tpool_dispatch: fail if it cannot start at least 1 worker. 2024-05-14 09:35:48 -07:00
libunicode cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libuutil JSON output support for zpool status 2024-08-06 12:47:10 -07:00
libzdb Provide macros for setting and getting blkptr birth times 2024-03-25 15:01:54 -07:00
libzfs zcommon: add specialized versions of cityhash4 2024-09-19 15:18:59 -07:00
libzfs_core Add DDT prune command 2024-09-04 14:17:02 -07:00
libzfsbootenv nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
libzpool zfs_file: implement zfs_file_deallocate for FreeBSD 14 2024-09-18 11:35:48 -07:00
libzstd libzstd: also build with LIBZPOOL_CPPFLAGS 2024-09-09 14:13:27 -07:00
libzutil libzfs: use zfs_strerror() in place of strerror() 2024-01-29 09:54:57 -08:00
Makefile.am libzdb: Initial breakout of libzdb 2024-02-05 10:00:41 -08:00