003 File Manager
Current Path:
/usr/src/sys/contrib/openzfs/module/zfs
usr
/
src
/
sys
/
contrib
/
openzfs
/
module
/
zfs
/
π
..
π
Makefile.in
(4.57 KB)
π
THIRDPARTYLICENSE.cityhash
(1.03 KB)
π
THIRDPARTYLICENSE.cityhash.descrip
(39 B)
π
abd.c
(31.72 KB)
π
aggsum.c
(8.46 KB)
π
arc.c
(330.91 KB)
π
blkptr.c
(4.26 KB)
π
bplist.c
(2.38 KB)
π
bpobj.c
(27.82 KB)
π
bptree.c
(8.2 KB)
π
bqueue.c
(4.7 KB)
π
btree.c
(65.19 KB)
π
dataset_kstats.c
(6.32 KB)
π
dbuf.c
(141.84 KB)
π
dbuf_stats.c
(6.05 KB)
π
ddt.c
(28.01 KB)
π
ddt_zap.c
(4.38 KB)
π
dmu.c
(60.44 KB)
π
dmu_diff.c
(6.25 KB)
π
dmu_object.c
(14.73 KB)
π
dmu_objset.c
(79.38 KB)
π
dmu_recv.c
(98.69 KB)
π
dmu_redact.c
(37.09 KB)
π
dmu_send.c
(95.51 KB)
π
dmu_traverse.c
(21.98 KB)
π
dmu_tx.c
(40.13 KB)
π
dmu_zfetch.c
(13.56 KB)
π
dnode.c
(71.32 KB)
π
dnode_sync.c
(24.93 KB)
π
dsl_bookmark.c
(51.22 KB)
π
dsl_crypt.c
(78.06 KB)
π
dsl_dataset.c
(141.61 KB)
π
dsl_deadlist.c
(27.94 KB)
π
dsl_deleg.c
(19.92 KB)
π
dsl_destroy.c
(36.73 KB)
π
dsl_dir.c
(65.45 KB)
π
dsl_pool.c
(42.92 KB)
π
dsl_prop.c
(32.88 KB)
π
dsl_scan.c
(134.47 KB)
π
dsl_synctask.c
(7.94 KB)
π
dsl_userhold.c
(18.26 KB)
π
edonr_zfs.c
(3.21 KB)
π
fm.c
(39.75 KB)
π
gzip.c
(2.57 KB)
π
hkdf.c
(4.5 KB)
π
lz4.c
(26.46 KB)
π
lzjb.c
(3.85 KB)
π
metaslab.c
(190.62 KB)
π
mmp.c
(24.93 KB)
π
multilist.c
(12.21 KB)
π
objlist.c
(2.58 KB)
π
pathname.c
(2.52 KB)
π
range_tree.c
(24.9 KB)
π
refcount.c
(7.82 KB)
π
rrwlock.c
(10.82 KB)
π
sa.c
(59.23 KB)
π
sha256.c
(2.89 KB)
π
skein_zfs.c
(2.92 KB)
π
spa.c
(272.81 KB)
π
spa_boot.c
(1.28 KB)
π
spa_checkpoint.c
(21.54 KB)
π
spa_config.c
(16.97 KB)
π
spa_errlog.c
(11.35 KB)
π
spa_history.c
(17.75 KB)
π
spa_log_spacemap.c
(47.13 KB)
π
spa_misc.c
(75.4 KB)
π
spa_stats.c
(27.08 KB)
π
space_map.c
(31.45 KB)
π
space_reftree.c
(4.21 KB)
π
txg.c
(27.49 KB)
π
uberblock.c
(2.17 KB)
π
unique.c
(2.53 KB)
π
vdev.c
(143.91 KB)
π
vdev_cache.c
(11.71 KB)
π
vdev_draid.c
(96.86 KB)
π
vdev_draid_rand.c
(1.16 KB)
π
vdev_indirect.c
(60.83 KB)
π
vdev_indirect_births.c
(5.88 KB)
π
vdev_indirect_mapping.c
(18.06 KB)
π
vdev_initialize.c
(22.38 KB)
π
vdev_label.c
(57.52 KB)
π
vdev_mirror.c
(26.76 KB)
π
vdev_missing.c
(3.74 KB)
π
vdev_queue.c
(37.61 KB)
π
vdev_raidz.c
(76.09 KB)
π
vdev_raidz_math.c
(17.18 KB)
π
vdev_raidz_math_aarch64_neon.c
(112.13 KB)
π
vdev_raidz_math_aarch64_neon_common.h
(23.64 KB)
π
vdev_raidz_math_aarch64_neonx2.c
(5.39 KB)
π
vdev_raidz_math_avx2.c
(10.64 KB)
π
vdev_raidz_math_avx512bw.c
(10.93 KB)
π
vdev_raidz_math_avx512f.c
(17.9 KB)
π
vdev_raidz_math_impl.h
(34.78 KB)
π
vdev_raidz_math_powerpc_altivec.c
(213.46 KB)
π
vdev_raidz_math_powerpc_altivec_common.h
(22.62 KB)
π
vdev_raidz_math_scalar.c
(9.54 KB)
π
vdev_raidz_math_sse2.c
(25.84 KB)
π
vdev_raidz_math_ssse3.c
(118 KB)
π
vdev_rebuild.c
(34.65 KB)
π
vdev_removal.c
(72.08 KB)
π
vdev_root.c
(4.28 KB)
π
vdev_trim.c
(50.92 KB)
π
zap.c
(35.35 KB)
π
zap_leaf.c
(22.75 KB)
π
zap_micro.c
(42.18 KB)
π
zcp.c
(42.29 KB)
π
zcp_get.c
(21.01 KB)
π
zcp_global.c
(1.9 KB)
π
zcp_iter.c
(18.21 KB)
π
zcp_set.c
(2.37 KB)
π
zcp_synctask.c
(13.69 KB)
π
zfeature.c
(17.6 KB)
π
zfs_byteswap.c
(5.64 KB)
π
zfs_fm.c
(40.58 KB)
π
zfs_fuid.c
(19.69 KB)
π
zfs_ioctl.c
(195.48 KB)
π
zfs_log.c
(20.6 KB)
π
zfs_onexit.c
(5.09 KB)
π
zfs_quota.c
(12.93 KB)
π
zfs_ratelimit.c
(2.35 KB)
π
zfs_replay.c
(26.11 KB)
π
zfs_rlock.c
(20.38 KB)
π
zfs_sa.c
(13.09 KB)
π
zfs_vnops.c
(22 KB)
π
zil.c
(111.32 KB)
π
zio.c
(144.72 KB)
π
zio_checksum.c
(17.28 KB)
π
zio_compress.c
(5.92 KB)
π
zio_inject.c
(25.79 KB)
π
zle.c
(2.52 KB)
π
zrlock.c
(4.45 KB)
π
zthr.c
(16.41 KB)
π
zvol.c
(42.96 KB)
Editing: vdev_raidz_math_scalar.c
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (C) 2016 Gvozden NeΕ‘koviΔ. All rights reserved. */ #include <sys/vdev_raidz_impl.h> /* * Provide native CPU scalar routines. * Support 32bit and 64bit CPUs. */ #if ((~(0x0ULL)) >> 24) == 0xffULL #define ELEM_SIZE 4 typedef uint32_t iv_t; #elif ((~(0x0ULL)) >> 56) == 0xffULL #define ELEM_SIZE 8 typedef uint64_t iv_t; #endif /* * Vector type used in scalar implementation * * The union is expected to be of native CPU register size. Since addition * uses XOR operation, it can be performed an all byte elements at once. * Multiplication requires per byte access. */ typedef union { iv_t e; uint8_t b[ELEM_SIZE]; } v_t; /* * Precomputed lookup tables for multiplication by a constant * * Reconstruction path requires multiplication by a constant factors. Instead of * performing two step lookup (log & exp tables), a direct lookup can be used * instead. Multiplication of element 'a' by a constant 'c' is obtained as: * * r = vdev_raidz_mul_lt[c_log][a]; * * where c_log = vdev_raidz_log2[c]. Log of coefficient factors is used because * they are faster to obtain while solving the syndrome equations. * * PERFORMANCE NOTE: * Even though the complete lookup table uses 64kiB, only relatively small * portion of it is used at the same time. Following shows number of accessed * bytes for different cases: * - 1 failed disk: 256B (1 mul. coefficient) * - 2 failed disks: 512B (2 mul. coefficients) * - 3 failed disks: 1536B (6 mul. coefficients) * * Size of actually accessed lookup table regions is only larger for * reconstruction of 3 failed disks, when compared to traditional log/exp * method. But since the result is obtained in one lookup step performance is * doubled. */ static uint8_t vdev_raidz_mul_lt[256][256] __attribute__((aligned(256))); static void raidz_init_scalar(void) { int c, i; for (c = 0; c < 256; c++) for (i = 0; i < 256; i++) vdev_raidz_mul_lt[c][i] = gf_mul(c, i); } #define PREFETCHNTA(ptr, offset) {} #define PREFETCH(ptr, offset) {} #define XOR_ACC(src, acc) acc.e ^= ((v_t *)src)[0].e #define XOR(src, acc) acc.e ^= src.e #define ZERO(acc) acc.e = 0 #define COPY(src, dst) dst = src #define LOAD(src, val) val = ((v_t *)src)[0] #define STORE(dst, val) ((v_t *)dst)[0] = val /* * Constants used for optimized multiplication by 2. */ static const struct { iv_t mod; iv_t mask; iv_t msb; } scalar_mul2_consts = { #if ELEM_SIZE == 8 .mod = 0x1d1d1d1d1d1d1d1dULL, .mask = 0xfefefefefefefefeULL, .msb = 0x8080808080808080ULL, #else .mod = 0x1d1d1d1dULL, .mask = 0xfefefefeULL, .msb = 0x80808080ULL, #endif }; #define MUL2_SETUP() {} #define MUL2(a) \ { \ iv_t _mask; \ \ _mask = (a).e & scalar_mul2_consts.msb; \ _mask = (_mask << 1) - (_mask >> 7); \ (a).e = ((a).e << 1) & scalar_mul2_consts.mask; \ (a).e = (a).e ^ (_mask & scalar_mul2_consts.mod); \ } #define MUL4(a) \ { \ MUL2(a); \ MUL2(a); \ } #define MUL(c, a) \ { \ const uint8_t *mul_lt = vdev_raidz_mul_lt[c]; \ switch (ELEM_SIZE) { \ case 8: \ a.b[7] = mul_lt[a.b[7]]; \ a.b[6] = mul_lt[a.b[6]]; \ a.b[5] = mul_lt[a.b[5]]; \ a.b[4] = mul_lt[a.b[4]]; \ /* falls through */ \ case 4: \ a.b[3] = mul_lt[a.b[3]]; \ a.b[2] = mul_lt[a.b[2]]; \ a.b[1] = mul_lt[a.b[1]]; \ a.b[0] = mul_lt[a.b[0]]; \ break; \ } \ } #define raidz_math_begin() {} #define raidz_math_end() {} #define SYN_STRIDE 1 #define ZERO_DEFINE() v_t d0 #define ZERO_STRIDE 1 #define ZERO_D d0 #define COPY_DEFINE() v_t d0 #define COPY_STRIDE 1 #define COPY_D d0 #define ADD_DEFINE() v_t d0 #define ADD_STRIDE 1 #define ADD_D d0 #define MUL_DEFINE() v_t d0 #define MUL_STRIDE 1 #define MUL_D d0 #define GEN_P_STRIDE 1 #define GEN_P_DEFINE() v_t p0 #define GEN_P_P p0 #define GEN_PQ_STRIDE 1 #define GEN_PQ_DEFINE() v_t d0, c0 #define GEN_PQ_D d0 #define GEN_PQ_C c0 #define GEN_PQR_STRIDE 1 #define GEN_PQR_DEFINE() v_t d0, c0 #define GEN_PQR_D d0 #define GEN_PQR_C c0 #define SYN_Q_DEFINE() v_t d0, x0 #define SYN_Q_D d0 #define SYN_Q_X x0 #define SYN_R_DEFINE() v_t d0, x0 #define SYN_R_D d0 #define SYN_R_X x0 #define SYN_PQ_DEFINE() v_t d0, x0 #define SYN_PQ_D d0 #define SYN_PQ_X x0 #define REC_PQ_STRIDE 1 #define REC_PQ_DEFINE() v_t x0, y0, t0 #define REC_PQ_X x0 #define REC_PQ_Y y0 #define REC_PQ_T t0 #define SYN_PR_DEFINE() v_t d0, x0 #define SYN_PR_D d0 #define SYN_PR_X x0 #define REC_PR_STRIDE 1 #define REC_PR_DEFINE() v_t x0, y0, t0 #define REC_PR_X x0 #define REC_PR_Y y0 #define REC_PR_T t0 #define SYN_QR_DEFINE() v_t d0, x0 #define SYN_QR_D d0 #define SYN_QR_X x0 #define REC_QR_STRIDE 1 #define REC_QR_DEFINE() v_t x0, y0, t0 #define REC_QR_X x0 #define REC_QR_Y y0 #define REC_QR_T t0 #define SYN_PQR_DEFINE() v_t d0, x0 #define SYN_PQR_D d0 #define SYN_PQR_X x0 #define REC_PQR_STRIDE 1 #define REC_PQR_DEFINE() v_t x0, y0, z0, xs0, ys0 #define REC_PQR_X x0 #define REC_PQR_Y y0 #define REC_PQR_Z z0 #define REC_PQR_XS xs0 #define REC_PQR_YS ys0 #include "vdev_raidz_math_impl.h" DEFINE_GEN_METHODS(scalar); DEFINE_REC_METHODS(scalar); boolean_t raidz_will_scalar_work(void) { return (B_TRUE); /* always */ } const raidz_impl_ops_t vdev_raidz_scalar_impl = { .init = raidz_init_scalar, .fini = NULL, .gen = RAIDZ_GEN_METHODS(scalar), .rec = RAIDZ_REC_METHODS(scalar), .is_supported = &raidz_will_scalar_work, .name = "scalar" }; /* Powers of 2 in the RAID-Z Galois field. */ const uint8_t vdev_raidz_pow2[256] __attribute__((aligned(256))) = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x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 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6, 0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09, 0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16, 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x01 }; /* Logs of 2 in the RAID-Z Galois field. */ const uint8_t vdev_raidz_log2[256] __attribute__((aligned(256))) = { 0x00, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b, 0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81, 0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71, 0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21, 0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45, 0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9, 0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6, 0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd, 0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88, 0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd, 0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40, 0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e, 0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d, 0xca, 0x5e, 0x9b, 0x9f, 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