diff options
author | Gvozden Neskovic <[email protected]> | 2016-04-25 10:04:31 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-06-21 09:27:26 -0700 |
commit | ab9f4b0b824ab4cc64a4fa382c037f4154de12d6 (patch) | |
tree | e38dea4c254c26e528aa0410bc39031f7901c520 /tests | |
parent | 09fb30e5e91d9f2ed622db6b616084ce1d073384 (diff) |
SIMD implementation of vdev_raidz generate and reconstruct routines
This is a new implementation of RAIDZ1/2/3 routines using x86_64
scalar, SSE, and AVX2 instruction sets. Included are 3 parity
generation routines (P, PQ, and PQR) and 7 reconstruction routines,
for all RAIDZ level. On module load, a quick benchmark of supported
routines will select the fastest for each operation and they will
be used at runtime. Original implementation is still present and
can be selected via module parameter.
Patch contains:
- specialized gen/rec routines for all RAIDZ levels,
- new scalar raidz implementation (unrolled),
- two x86_64 SIMD implementations (SSE and AVX2 instructions sets),
- fastest routines selected on module load (benchmark).
- cmd/raidz_test - verify and benchmark all implementations
- added raidz_test to the ZFS Test Suite
New zfs module parameters:
- zfs_vdev_raidz_impl (str): selects the implementation to use. On
module load, the parameter will only accept first 3 options, and
the other implementations can be set once module is finished
loading. Possible values for this option are:
"fastest" - use the fastest math available
"original" - use the original raidz code
"scalar" - new scalar impl
"sse" - new SSE impl if available
"avx2" - new AVX2 impl if available
See contents of `/sys/module/zfs/parameters/zfs_vdev_raidz_impl` to
get the list of supported values. If an implementation is not supported
on the system, it will not be shown. Currently selected option is
enclosed in `[]`.
Signed-off-by: Gvozden Neskovic <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #4328
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runfiles/linux.run | 7 | ||||
-rw-r--r-- | tests/zfs-tests/include/default.cfg.in | 1 | ||||
-rw-r--r-- | tests/zfs-tests/tests/functional/Makefile.am | 1 | ||||
-rw-r--r-- | tests/zfs-tests/tests/functional/raidz/Makefile.am | 6 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/raidz/cleanup.ksh | 30 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh | 38 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh | 41 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/raidz/setup.ksh | 32 |
8 files changed, 154 insertions, 2 deletions
diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run index ad20d352a..1f52d2815 100644 --- a/tests/runfiles/linux.run +++ b/tests/runfiles/linux.run @@ -262,7 +262,7 @@ tests = ['zpool_clear_001_pos', 'zpool_clear_002_neg', 'zpool_clear_003_neg'] # zpool_create_020_pos - needs investigation [tests/functional/cli_root/zpool_create] tests = [ - 'zpool_create_003_pos', 'zpool_create_005_pos', 'zpool_create_007_neg', + 'zpool_create_003_pos', 'zpool_create_005_pos', 'zpool_create_007_neg', 'zpool_create_009_neg', 'zpool_create_010_neg', 'zpool_create_017_neg', 'zpool_create_018_pos', 'zpool_create_019_pos', 'zpool_create_021_pos', 'zpool_create_022_pos', 'zpool_create_023_neg', @@ -512,12 +512,15 @@ tests = ['poolversion_001_pos', 'poolversion_002_pos'] #tests = ['privilege_001_pos', 'privilege_002_pos'] # DISABLED: -# quota_002_pos - size is less than current used or reserved space +# quota_002_pos - size is less than current used or reserved space # quota_004_pos - size is less than current used or reserved space # quota_005_pos - size is less than current used or reserved space [tests/functional/quota] tests = ['quota_001_pos', 'quota_003_pos', 'quota_006_neg'] +[tests/functional/raidz] +tests = ['raidz_001_neg', 'raidz_002_pos'] + [tests/functional/redundancy] tests = ['redundancy_001_pos', 'redundancy_002_pos', 'redundancy_003_pos'] diff --git a/tests/zfs-tests/include/default.cfg.in b/tests/zfs-tests/include/default.cfg.in index 2fd9a9830..9474c489e 100644 --- a/tests/zfs-tests/include/default.cfg.in +++ b/tests/zfs-tests/include/default.cfg.in @@ -42,6 +42,7 @@ export ZINJECT=${ZINJECT:-${sbindir}/zinject} export ZPOOL=${ZPOOL:-${sbindir}/zpool} export ZTEST=${ZTEST:-${sbindir}/ztest} export ZPIOS=${ZPIOS:-${sbindir}/zpios} +export RAIDZ_TEST=${RAIDZ_TEST:-${bindir}/raidz_test} . $STF_SUITE/include/libtest.shlib diff --git a/tests/zfs-tests/tests/functional/Makefile.am b/tests/zfs-tests/tests/functional/Makefile.am index 9aea472b2..79d33a14b 100644 --- a/tests/zfs-tests/tests/functional/Makefile.am +++ b/tests/zfs-tests/tests/functional/Makefile.am @@ -34,6 +34,7 @@ SUBDIRS = \ poolversion \ privilege \ quota \ + raidz \ redundancy \ refquota \ refreserv \ diff --git a/tests/zfs-tests/tests/functional/raidz/Makefile.am b/tests/zfs-tests/tests/functional/raidz/Makefile.am new file mode 100644 index 000000000..694de18a6 --- /dev/null +++ b/tests/zfs-tests/tests/functional/raidz/Makefile.am @@ -0,0 +1,6 @@ +pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/raidz +dist_pkgdata_SCRIPTS = \ + setup.ksh \ + cleanup.ksh \ + raidz_001_neg.ksh \ + raidz_002_pos.ksh diff --git a/tests/zfs-tests/tests/functional/raidz/cleanup.ksh b/tests/zfs-tests/tests/functional/raidz/cleanup.ksh new file mode 100755 index 000000000..c92c54c27 --- /dev/null +++ b/tests/zfs-tests/tests/functional/raidz/cleanup.ksh @@ -0,0 +1,30 @@ +#!/bin/ksh -p +# +# 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 by Gvozden Neskovic. All rights reserved. +# Use is subject to license terms. +# + +. $STF_SUITE/include/libtest.shlib + +# default_cleanup diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh new file mode 100755 index 000000000..158ce678d --- /dev/null +++ b/tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh @@ -0,0 +1,38 @@ +#!/bin/ksh -p +# +# 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 by Gvozden Neskovic. All rights reserved. +# Use is subject to license terms. +# + +. $STF_SUITE/include/libtest.shlib + +# +# DESCRIPTION: +# Call the raidz_test tool with -T options to test the infrastructure. +# This option should make raidz_test to return non 0. +# + +log_mustnot $RAIDZ_TEST -T + +log_pass "raidz_test detects errors as espected." diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh new file mode 100755 index 000000000..b33bd1b90 --- /dev/null +++ b/tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh @@ -0,0 +1,41 @@ +#!/bin/ksh -p +# +# 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 by Gvozden Neskovic. All rights reserved. +# Use is subject to license terms. +# + +. $STF_SUITE/include/libtest.shlib + +# +# DESCRIPTION: +# Call the raidz_test tool with -S to test all supported raidz +# implementations. This options will test several raidz block geometries +# and several zio parameters that affect raidz block layout. Data +# reconstruction performs all combinations of failed disks. Wall time +# is set to 5min, but actual runtime might be longer. +# + +log_must $RAIDZ_TEST -S -t 300 + +log_pass "raidz_test parameter sweep test succeeded." diff --git a/tests/zfs-tests/tests/functional/raidz/setup.ksh b/tests/zfs-tests/tests/functional/raidz/setup.ksh new file mode 100755 index 000000000..4e155d24d --- /dev/null +++ b/tests/zfs-tests/tests/functional/raidz/setup.ksh @@ -0,0 +1,32 @@ +#!/bin/ksh -p +# +# 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 by Gvozden Neskovic. All rights reserved. +# Use is subject to license terms. +# + +. $STF_SUITE/include/libtest.shlib + +verify_runnable "global" + +log_pass |