mirror_zfs/config
Brian Behlendorf e5db313494
Linux 5.0 compat: SIMD compatibility
Restore the SIMD optimization for 4.19.38 LTS, 4.14.120 LTS,
and 5.0 and newer kernels.  This is accomplished by leveraging
the fact that by definition dedicated kernel threads never need
to concern themselves with saving and restoring the user FPU state.
Therefore, they may use the FPU as long as we can guarantee user
tasks always restore their FPU state before context switching back
to user space.

For the 5.0 and 5.1 kernels disabling preemption and local
interrupts is sufficient to allow the FPU to be used.  All non-kernel
threads will restore the preserved user FPU state.

For 5.2 and latter kernels the user FPU state restoration will be
skipped if the kernel determines the registers have not changed.
Therefore, for these kernels we need to perform the additional
step of saving and restoring the FPU registers.  Invalidating the
per-cpu global tracking the FPU state would force a restore but
that functionality is private to the core x86 FPU implementation
and unavailable.

In practice, restricting SIMD to kernel threads is not a major
restriction for ZFS.  The vast majority of SIMD operations are
already performed by the IO pipeline.  The remaining cases are
relatively infrequent and can be handled by the generic code
without significant impact.  The two most noteworthy cases are:

  1) Decrypting the wrapping key for an encrypted dataset,
     i.e. `zfs load-key`.  All other encryption and decryption
     operations will use the SIMD optimized implementations.

  2) Generating the payload checksums for a `zfs send` stream.

In order to avoid making any changes to the higher layers of ZFS
all of the `*_get_ops()` functions were updated to take in to
consideration the calling context.  This allows for the fastest
implementation to be used as appropriate (see kfpu_allowed()).

The only other notable instance of SIMD operations being used
outside a kernel thread was at module load time.  This code
was moved in to a taskq in order to accommodate the new kernel
thread restriction.

Finally, a few other modifications were made in order to further
harden this code and facilitate testing.  They include updating
each implementations operations structure to be declared as a
constant.  And allowing "cycle" to be set when selecting the
preferred ops in the kernel as well as user space.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8754 
Closes #8793 
Closes #8965
2019-07-12 09:31:20 -07:00
..
.gitignore Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
always-arch.m4 Illumos Crypto Port module added to enable native encryption in zfs 2016-07-20 10:43:30 -07:00
always-compiler-options.m4 compile with -fno-omit-frame-pointer 2019-04-14 11:04:54 -07:00
always-python.m4 Python config cleanup 2019-06-13 13:15:46 -07:00
always-pyzfs.m4 Python config cleanup 2019-06-13 13:15:46 -07:00
ax_code_coverage.m4 Fix "--enable-code-coverage" debug build 2017-09-22 22:16:18 -07:00
ax_python_devel.m4 Adopt pyzfs from ClusterHQ 2018-05-01 10:33:35 -07:00
ax_restore_flags.m4 config: better libtirpc detection 2019-03-02 16:19:05 -08:00
ax_save_flags.m4 config: better libtirpc detection 2019-03-02 16:19:05 -08:00
config.awk Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
config.rpath Prevent make distclean removing config/config.rpath 2019-04-26 11:22:14 -07:00
deb.am Fix dracut Debian/Ubuntu packaging 2019-07-09 09:28:05 -07:00
find_system_library.m4 config: better libtirpc detection 2019-03-02 16:19:05 -08:00
gettext.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
host-cpu-c-abi.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
iconv.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
intlmacosx.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
kernel-access-ok-type.m4 Linux 5.0 compat: access_ok() drops 'type' parameter 2019-01-28 10:11:10 -08:00
kernel-acl-refcount.m4 Linux 4.16 compat: use correct *_dec_and_test() 2018-02-22 09:02:06 -08:00
kernel-acl.m4 Fix config issues: frame size and headers 2018-02-15 12:58:23 -08:00
kernel-aio-fsync.m4 Kernel 4.9 compat: file_operations->aio_fsync removal 2016-11-15 09:20:46 -08:00
kernel-automount.m4 Fix snapshot automounting with GrSecurity constify plugin. 2012-08-24 08:56:38 -07:00
kernel-bdev-logical-size.m4 Only use gcc -Wunused-but-set-variable when available 2013-01-10 16:09:39 -08:00
kernel-bdev-physical-size.m4 Only use gcc -Wunused-but-set-variable when available 2013-01-10 16:09:39 -08:00
kernel-bdi.m4 Fix autoconf detection of super_setup_bdi_name 2017-07-25 10:30:20 -07:00
kernel-bio_set_dev.m4 Linux 5.0 compat: Fix bio_set_dev() 2019-01-28 10:11:45 -08:00
kernel-bio-bvec-iter.m4 Linux 3.14 compat: Immutable biovec changes in vdev_disk.c 2014-04-10 14:28:38 -07:00
kernel-bio-end-io-t-args.m4 Linux 4.13 compat: bio->bi_status and blk_status_t 2017-07-23 19:37:12 -07:00
kernel-bio-failfast.m4 Linux 2.6.36 compat, use REQ_FAILFAST_MASK and remove pre-2.6.36 support 2015-05-11 15:07:00 -07:00
kernel-bio-op.m4 Fix RHEL 7.4 bio_set_op_attrs build error 2017-06-27 12:00:27 -07:00
kernel-bio-rw-barrier.m4 zvol processing should use struct bio 2015-09-04 15:30:24 -04:00
kernel-bio-rw-discard.m4 zvol processing should use struct bio 2015-09-04 15:30:24 -04:00
kernel-blk-queue-bdi.m4 Enable Linux read-ahead for a single page on ZVOLs 2017-05-04 18:00:27 -04:00
kernel-blk-queue-discard.m4 Add TRIM support 2019-03-29 09:13:20 -07:00
kernel-blk-queue-flags.m4 Linux compat 4.16: blk_queue_flag_{set,clear} 2018-04-10 10:32:14 -07:00
kernel-blk-queue-flush.m4 Linux 4.7 compat: replace blk_queue_flush with blk_queue_write_cache 2016-05-20 11:08:55 -07:00
kernel-blk-queue-max-hw-sectors.m4 Only use gcc -Wunused-but-set-variable when available 2013-01-10 16:09:39 -08:00
kernel-blk-queue-max-segments.m4 Only use gcc -Wunused-but-set-variable when available 2013-01-10 16:09:39 -08:00
kernel-blk-queue-unplug.m4 Explicit block device plugging when submitting multiple BIOs 2016-09-29 13:13:31 -07:00
kernel-blkdev-get-by-path.m4 When checking for symbol exports, try compiling. 2012-07-26 13:42:57 -07:00
kernel-blkdev-reread-part.m4 Add support for autoexpand property 2018-07-23 15:40:15 -07:00
kernel-block-device-operations.m4 Linux compat 4.18: check_disk_size_change() 2018-06-15 15:05:21 -07:00
kernel-clear-inode.m4 When checking for symbol exports, try compiling. 2012-07-26 13:42:57 -07:00
kernel-commit-metadata.m4 Implement .commit_metadata hook for NFS export 2012-10-03 10:49:45 -07:00
kernel-create-nameidata.m4 Fix config issues: frame size and headers 2018-02-15 12:58:23 -08:00
kernel-ctl-table-name.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-current_bio_tail.m4 zvol processing should use struct bio 2015-09-04 15:30:24 -04:00
kernel-current-time.m4 Linux 4.18 compat: inode timespec -> timespec64 2018-06-19 21:51:18 -07:00
kernel-d-make-root.m4 When checking for symbol exports, try compiling. 2012-07-26 13:42:57 -07:00
kernel-d-obtain-alias.m4 When checking for symbol exports, try compiling. 2012-07-26 13:42:57 -07:00
kernel-d-prune-aliases.m4 Add zfs_sb_prune_aliases() function 2015-06-22 10:22:49 -07:00
kernel-declare-event-class.m4 Swap DTRACE_PROBE* with Linux tracepoints 2014-11-17 11:13:55 -08:00
kernel-dentry-operations.m4 Fix config issues: frame size and headers 2018-02-15 12:58:23 -08:00
kernel-dirty-inode.m4 Eliminate runtime function pointer mods in autotools checks 2013-03-04 08:49:17 -08:00
kernel-discard-granularity.m4 Set zvol discard_granularity to the volblocksize. 2012-08-07 14:55:31 -07:00
kernel-elevator-change.m4 Linux 4.14 compat: blk_queue_stackable() 2018-06-19 21:52:45 -07:00
kernel-encode-fh-inode.m4 Linux 3.5 compat, eops->encode_fh() takes inodes 2012-07-23 12:29:23 -07:00
kernel-evict-inode.m4 Fix build failures on PaX/GRSecurity patched kernels 2012-07-17 09:22:43 -07:00
kernel-fallocate-pax.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-fallocate.m4 Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
kernel-file-dentry.m4 Use file_dentry and file_inode wrappers 2016-08-11 12:06:37 -07:00
kernel-file-inode.m4 Linux 3.19 compat: file_inode was added 2015-02-10 11:24:51 -08:00
kernel-fmode-t.m4 Fix gcc configure warnings 2011-04-19 10:10:47 -07:00
kernel-follow-down-one.m4 Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
kernel-fpu.m4 Linux 5.0 compat: SIMD compatibility 2019-07-12 09:31:20 -07:00
kernel-fst-mount.m4 Allow mounting datasets more than once 2018-04-13 10:44:05 -07:00
kernel-fsync.m4 Eliminate runtime function pointer mods in autotools checks 2013-03-04 08:49:17 -08:00
kernel-generic_io_acct.m4 Linux 3.14 compat: IO acct, global_page_state, etc 2017-09-16 11:00:19 -07:00
kernel-generic_readlink.m4 4.10 compat - BIO flag changes and others 2016-12-30 16:03:59 -06:00
kernel-get-disk-and-module.m4 Linux 4.16 compat: get_disk_and_module() 2018-03-05 12:44:35 -08:00
kernel-get-disk-ro.m4 Only use gcc -Wunused-but-set-variable when available 2013-01-10 16:09:39 -08:00
kernel-get-link.m4 Fix config issues: frame size and headers 2018-02-15 12:58:23 -08:00
kernel-global_page_state.m4 Fix free memory calculation on v3.14+ 2018-02-23 08:50:06 -08:00
kernel-group-info.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-in-compat-syscall.m4 Fix statfs(2) for 32-bit user space 2018-09-24 17:11:25 -07:00
kernel-inode-getattr.m4 Linux 4.11 compat: iops.getattr and friends 2017-03-20 17:51:16 -07:00
kernel-inode-lock.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-inode-set-flags.m4 Use inode_set_flags when available 2016-12-16 13:54:51 -08:00
kernel-inode-set-iversion.m4 Linux 4.16 compat: inode_set_iversion() 2018-02-08 21:25:19 -08:00
kernel-inode-times.m4 Linux 4.18 compat: inode timespec -> timespec64 2018-06-19 21:51:18 -07:00
kernel-insert-inode-locked.m4 When checking for symbol exports, try compiling. 2012-07-26 13:42:57 -07:00
kernel-invalidate-bdev-args.m4 Fix gcc configure warnings 2011-04-19 10:10:47 -07:00
kernel-is_owner_or_cap.m4 Refactor inode_owner_or_capable() autotools check 2014-05-01 10:06:49 -07:00
kernel-kmap-atomic-args.m4 Add compatibility layer for {kmap,kunmap}_atomic 2015-08-24 10:13:25 -07:00
kernel-kmem-cache.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-kmem.m4 Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
kernel-kstrtoul.m4 Linux 2.6.39 compat: Test if kstrtoul() exists 2019-05-24 12:26:18 -07:00
kernel-ktime_get_coarse_real_ts64.m4 Linux 4.18 compat: Use ktime_get_coarse_real_ts64() 2019-01-28 10:11:03 -08:00
kernel-kuid-helpers.m4 Check whether the kernel supports i_uid/gid_read/write helpers 2016-07-25 13:21:49 -07:00
kernel-kuidgid.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-lookup-bdev.m4 Fix lookup_bdev() on Ubuntu 2016-10-26 10:30:43 -07:00
kernel-lookup-nameidata.m4 Fix config issues: frame size and headers 2018-02-15 12:58:23 -08:00
kernel-lseek-execute.m4 Add SEEK_DATA/SEEK_HOLE to lseek()/llseek() 2013-07-02 09:24:43 -07:00
kernel-misc-minor.m4 Rename macro ZFS_MINOR due to Lustre conflict 2018-12-10 16:52:49 -08:00
kernel-mk-request-fn.m4 Linux 4.4 compat: make_request_fn returns blk_qc_t 2015-12-01 16:48:08 -08:00
kernel-mkdir-umode-t.m4 Fix spelling 2017-01-03 11:31:18 -06:00
kernel-mod-param.m4 Linux compat: Grsecurity kernel 2016-08-22 10:05:45 -07:00
kernel-objtool.m4 Suppress incorrect objtool warnings 2017-12-07 10:28:50 -08:00
kernel-open-bdev-exclusive.m4 When checking for symbol exports, try compiling. 2012-07-26 13:42:57 -07:00
kernel-pde-data.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-put-link.m4 Linux 4.5 compat: get_link() / put_link() 2016-01-20 11:36:00 -08:00
kernel-rename.m4 Linux 4.9 compat: iops->rename() wants flags 2016-10-20 09:39:09 -07:00
kernel-rw.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-rwsem.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-sched.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-security-inode-init.m4 Use -Werror for all kernel configure tests. 2013-02-24 10:20:28 -08:00
kernel-set-nlink.m4 Linux 3.2 compat: set_nlink() 2011-12-16 20:02:52 -08:00
kernel-setattr-prepare.m4 Linux 4.9 compat: inode_change_ok() renamed setattr_prepare() 2016-10-20 09:39:09 -07:00
kernel-sget-args.m4 Linux 3.6 compat, sget() 2012-10-14 13:06:48 -07:00
kernel-show-options.m4 Fix NULL pointer dereference on PaX/GRSecurity patched Linux 3.3 and later kernels 2012-07-20 12:31:45 -07:00
kernel-shrink.m4 Linux 5.2 compat: Fix config/kernel-shrink.m4 test failure 2019-05-25 13:40:46 -07:00
kernel-submit_bio.m4 Linux 4.8 compat: submit_bio() 2016-07-29 14:48:00 -07:00
kernel-super-userns.m4 Linux 4.8 compat: new s_user_ns member of struct super_block 2016-08-08 10:47:22 -07:00
kernel-timer.m4 kernel timer API rework 2019-05-23 14:40:28 -07:00
kernel-tmpfile.m4 Add support for O_TMPFILE 2016-11-04 10:46:40 -07:00
kernel-totalhigh_pages.m4 Linux 5.0 compat: Use totalhigh_pages() 2019-05-04 16:40:48 -07:00
kernel-totalram-pages-func.m4 Linux 5.0 compat: Use totalram_pages() 2019-01-28 10:11:14 -08:00
kernel-truncate-range.m4 Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
kernel-truncate-setsize.m4 When checking for symbol exports, try compiling. 2012-07-26 13:42:57 -07:00
kernel-urange-sleep.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-userns-capabilities.m4 Take user namespaces into account in policy checks 2018-03-07 15:40:42 -08:00
kernel-vfs-direct_IO.m4 Direct IO support 2018-08-27 10:04:21 -07:00
kernel-vfs-fsync.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-vfs-getattr.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-vfs-iterate.m4 RHEL 7.5 compat: FMODE_KABI_ITERATE 2018-05-02 15:01:24 -07:00
kernel-vfs-rw-iterate.m4 Fix incompatibility with Reiser4 patched kernels 2018-01-09 16:18:19 -08:00
kernel-wait.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel-xattr-handler.m4 Fix spelling 2017-01-03 11:31:18 -06:00
kernel-zlib.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00
kernel.m4 Allow TRIM_UNUSED_KSYM when build as a builtin-module 2019-06-04 18:12:16 -07:00
lib-ld.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
lib-link.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
lib-prefix.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
mount-helper.m4 The mount helper mount.zfs MUST be in /sbin (not '$sbindir'). 2015-05-18 16:54:36 -07:00
nls.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
pkg.m4 config: better libtirpc detection 2019-03-02 16:19:05 -08:00
po.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
progtest.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
rpm.am Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
Rules.am compile with -fno-omit-frame-pointer 2019-04-14 11:04:54 -07:00
suppressed-warnings.txt Suppress packaging warning 2011-11-08 11:32:04 -08:00
tgz.am Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
toolchain-simd.m4 Add support for selecting encryption backend 2018-08-02 11:59:24 -07:00
user-dracut.m4 Accept udev and dracut paths specified by ./configure 2014-06-11 16:32:57 -07:00
user-gettext.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
user-libaio.m4 Fix mmap / libaio deadlock 2018-03-28 10:19:22 -07:00
user-libblkid.m4 Fix config issues: frame size and headers 2018-02-15 12:58:23 -08:00
user-libexec.m4 Tunable directory for zfs runtime scripts 2018-06-07 09:59:59 -07:00
user-libssl.m4 Fix config issues: frame size and headers 2018-02-15 12:58:23 -08:00
user-libtirpc.m4 config: better libtirpc detection 2019-03-02 16:19:05 -08:00
user-libudev.m4 Fix WANT_DEVNAME2DEVID configure error 2016-04-01 09:06:54 -07:00
user-libuuid.m4 Cleanup linking 2016-03-18 13:31:11 -07:00
user-makedev.m4 glibc 2.5 compat: use correct header for makedev() et al. 2017-03-31 09:32:00 -07:00
user-runstatedir.m4 Add defs for makefile installation dir vars 2014-03-31 16:11:13 -07:00
user-systemd.m4 Fix systemd spec file macros 2018-11-11 18:06:36 -08:00
user-sysvinit.m4 Add systemd unit files for ZFS startup 2014-02-05 12:25:30 -08:00
user-udev.m4 Accept udev and dracut paths specified by ./configure 2014-06-11 16:32:57 -07:00
user-zlib.m4 Cleanup linking 2016-03-18 13:31:11 -07:00
user.m4 config: libintl/libiconv for gettext() detection 2019-04-19 12:09:29 -07:00
zfs-build.m4 compile with -fno-omit-frame-pointer 2019-04-14 11:04:54 -07:00
zfs-meta.m4 Update build system and packaging 2018-05-29 16:00:33 -07:00