mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 19:39:35 +03:00
1b939560be
UNMAP/TRIM support is a frequently-requested feature to help prevent performance from degrading on SSDs and on various other SAN-like storage back-ends. By issuing UNMAP/TRIM commands for sectors which are no longer allocated the underlying device can often more efficiently manage itself. This TRIM implementation is modeled on the `zpool initialize` feature which writes a pattern to all unallocated space in the pool. The new `zpool trim` command uses the same vdev_xlate() code to calculate what sectors are unallocated, the same per- vdev TRIM thread model and locking, and the same basic CLI for a consistent user experience. The core difference is that instead of writing a pattern it will issue UNMAP/TRIM commands for those extents. The zio pipeline was updated to accommodate this by adding a new ZIO_TYPE_TRIM type and associated spa taskq. This new type makes is straight forward to add the platform specific TRIM/UNMAP calls to vdev_disk.c and vdev_file.c. These new ZIO_TYPE_TRIM zios are handled largely the same way as ZIO_TYPE_READs or ZIO_TYPE_WRITEs. This makes it possible to largely avoid changing the pipieline, one exception is that TRIM zio's may exceed the 16M block size limit since they contain no data. In addition to the manual `zpool trim` command, a background automatic TRIM was added and is controlled by the 'autotrim' property. It relies on the exact same infrastructure as the manual TRIM. However, instead of relying on the extents in a metaslab's ms_allocatable range tree, a ms_trim tree is kept per metaslab. When 'autotrim=on', ranges added back to the ms_allocatable tree are also added to the ms_free tree. The ms_free tree is then periodically consumed by an autotrim thread which systematically walks a top level vdev's metaslabs. Since the automatic TRIM will skip ranges it considers too small there is value in occasionally running a full `zpool trim`. This may occur when the freed blocks are small and not enough time was allowed to aggregate them. An automatic TRIM and a manual `zpool trim` may be run concurrently, in which case the automatic TRIM will yield to the manual TRIM. Reviewed-by: Jorgen Lundman <lundman@lundman.net> Reviewed-by: Tim Chase <tim@chase2k.com> Reviewed-by: Matt Ahrens <mahrens@delphix.com> Reviewed-by: George Wilson <george.wilson@delphix.com> Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com> Contributions-by: Saso Kiselkov <saso.kiselkov@nexenta.com> Contributions-by: Tim Chase <tim@chase2k.com> Contributions-by: Chunwei Chen <tuxoko@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #8419 Closes #598
165 lines
4.8 KiB
Makefile
165 lines
4.8 KiB
Makefile
src = @abs_top_srcdir@/module/zfs
|
|
obj = @abs_builddir@
|
|
target_cpu = @target_cpu@
|
|
|
|
MODULE := zfs
|
|
|
|
obj-$(CONFIG_ZFS) := $(MODULE).o
|
|
|
|
ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
|
|
|
|
# Suppress unused-value warnings in sparc64 architecture headers
|
|
ifeq ($(target_cpu),sparc64)
|
|
ccflags-y += -Wno-unused-value
|
|
endif
|
|
|
|
# Suppress unused but set variable warnings often due to ASSERTs
|
|
ccflags-y += $(NO_UNUSED_BUT_SET_VARIABLE)
|
|
|
|
$(MODULE)-objs += abd.o
|
|
$(MODULE)-objs += aggsum.o
|
|
$(MODULE)-objs += arc.o
|
|
$(MODULE)-objs += blkptr.o
|
|
$(MODULE)-objs += bplist.o
|
|
$(MODULE)-objs += bpobj.o
|
|
$(MODULE)-objs += cityhash.o
|
|
$(MODULE)-objs += dbuf.o
|
|
$(MODULE)-objs += dbuf_stats.o
|
|
$(MODULE)-objs += bptree.o
|
|
$(MODULE)-objs += bqueue.o
|
|
$(MODULE)-objs += dataset_kstats.o
|
|
$(MODULE)-objs += ddt.o
|
|
$(MODULE)-objs += ddt_zap.o
|
|
$(MODULE)-objs += dmu.o
|
|
$(MODULE)-objs += dmu_diff.o
|
|
$(MODULE)-objs += dmu_object.o
|
|
$(MODULE)-objs += dmu_objset.o
|
|
$(MODULE)-objs += dmu_recv.o
|
|
$(MODULE)-objs += dmu_send.o
|
|
$(MODULE)-objs += dmu_traverse.o
|
|
$(MODULE)-objs += dmu_tx.o
|
|
$(MODULE)-objs += dmu_zfetch.o
|
|
$(MODULE)-objs += dnode.o
|
|
$(MODULE)-objs += dnode_sync.o
|
|
$(MODULE)-objs += dsl_dataset.o
|
|
$(MODULE)-objs += dsl_deadlist.o
|
|
$(MODULE)-objs += dsl_deleg.o
|
|
$(MODULE)-objs += dsl_bookmark.o
|
|
$(MODULE)-objs += dsl_dir.o
|
|
$(MODULE)-objs += dsl_crypt.o
|
|
$(MODULE)-objs += dsl_pool.o
|
|
$(MODULE)-objs += dsl_prop.o
|
|
$(MODULE)-objs += dsl_scan.o
|
|
$(MODULE)-objs += dsl_synctask.o
|
|
$(MODULE)-objs += edonr_zfs.o
|
|
$(MODULE)-objs += fm.o
|
|
$(MODULE)-objs += gzip.o
|
|
$(MODULE)-objs += hkdf.o
|
|
$(MODULE)-objs += lzjb.o
|
|
$(MODULE)-objs += lz4.o
|
|
$(MODULE)-objs += metaslab.o
|
|
$(MODULE)-objs += mmp.o
|
|
$(MODULE)-objs += multilist.o
|
|
$(MODULE)-objs += pathname.o
|
|
$(MODULE)-objs += policy.o
|
|
$(MODULE)-objs += range_tree.o
|
|
$(MODULE)-objs += refcount.o
|
|
$(MODULE)-objs += rrwlock.o
|
|
$(MODULE)-objs += sa.o
|
|
$(MODULE)-objs += sha256.o
|
|
$(MODULE)-objs += skein_zfs.o
|
|
$(MODULE)-objs += spa.o
|
|
$(MODULE)-objs += spa_boot.o
|
|
$(MODULE)-objs += spa_checkpoint.o
|
|
$(MODULE)-objs += spa_config.o
|
|
$(MODULE)-objs += spa_errlog.o
|
|
$(MODULE)-objs += spa_history.o
|
|
$(MODULE)-objs += spa_misc.o
|
|
$(MODULE)-objs += spa_stats.o
|
|
$(MODULE)-objs += space_map.o
|
|
$(MODULE)-objs += space_reftree.o
|
|
$(MODULE)-objs += txg.o
|
|
$(MODULE)-objs += trace.o
|
|
$(MODULE)-objs += uberblock.o
|
|
$(MODULE)-objs += unique.o
|
|
$(MODULE)-objs += vdev.o
|
|
$(MODULE)-objs += vdev_cache.o
|
|
$(MODULE)-objs += vdev_disk.o
|
|
$(MODULE)-objs += vdev_file.o
|
|
$(MODULE)-objs += vdev_indirect.o
|
|
$(MODULE)-objs += vdev_indirect_births.o
|
|
$(MODULE)-objs += vdev_indirect_mapping.o
|
|
$(MODULE)-objs += vdev_initialize.o
|
|
$(MODULE)-objs += vdev_label.o
|
|
$(MODULE)-objs += vdev_mirror.o
|
|
$(MODULE)-objs += vdev_missing.o
|
|
$(MODULE)-objs += vdev_queue.o
|
|
$(MODULE)-objs += vdev_raidz.o
|
|
$(MODULE)-objs += vdev_raidz_math.o
|
|
$(MODULE)-objs += vdev_raidz_math_scalar.o
|
|
$(MODULE)-objs += vdev_removal.o
|
|
$(MODULE)-objs += vdev_root.o
|
|
$(MODULE)-objs += vdev_trim.o
|
|
$(MODULE)-objs += zap.o
|
|
$(MODULE)-objs += zap_leaf.o
|
|
$(MODULE)-objs += zap_micro.o
|
|
$(MODULE)-objs += zcp.o
|
|
$(MODULE)-objs += zcp_get.o
|
|
$(MODULE)-objs += zcp_global.o
|
|
$(MODULE)-objs += zcp_iter.o
|
|
$(MODULE)-objs += zcp_synctask.o
|
|
$(MODULE)-objs += zfeature.o
|
|
$(MODULE)-objs += zfs_acl.o
|
|
$(MODULE)-objs += zfs_byteswap.o
|
|
$(MODULE)-objs += zfs_ctldir.o
|
|
$(MODULE)-objs += zfs_debug.o
|
|
$(MODULE)-objs += zfs_dir.o
|
|
$(MODULE)-objs += zfs_fm.o
|
|
$(MODULE)-objs += zfs_fuid.o
|
|
$(MODULE)-objs += zfs_ioctl.o
|
|
$(MODULE)-objs += zfs_log.o
|
|
$(MODULE)-objs += zfs_onexit.o
|
|
$(MODULE)-objs += zfs_ratelimit.o
|
|
$(MODULE)-objs += zfs_replay.o
|
|
$(MODULE)-objs += zfs_rlock.o
|
|
$(MODULE)-objs += zfs_sa.o
|
|
$(MODULE)-objs += zfs_sysfs.o
|
|
$(MODULE)-objs += zfs_vfsops.o
|
|
$(MODULE)-objs += zfs_vnops.o
|
|
$(MODULE)-objs += zfs_znode.o
|
|
$(MODULE)-objs += zil.o
|
|
$(MODULE)-objs += zio.o
|
|
$(MODULE)-objs += zio_checksum.o
|
|
$(MODULE)-objs += zio_compress.o
|
|
$(MODULE)-objs += zio_crypt.o
|
|
$(MODULE)-objs += zio_inject.o
|
|
$(MODULE)-objs += zle.o
|
|
$(MODULE)-objs += zpl_ctldir.o
|
|
$(MODULE)-objs += zpl_export.o
|
|
$(MODULE)-objs += zpl_file.o
|
|
$(MODULE)-objs += zpl_inode.o
|
|
$(MODULE)-objs += zpl_super.o
|
|
$(MODULE)-objs += zpl_xattr.o
|
|
$(MODULE)-objs += zrlock.o
|
|
$(MODULE)-objs += zthr.o
|
|
$(MODULE)-objs += zvol.o
|
|
$(MODULE)-objs += dsl_destroy.o
|
|
$(MODULE)-objs += dsl_userhold.o
|
|
$(MODULE)-objs += qat.o
|
|
$(MODULE)-objs += qat_compress.o
|
|
$(MODULE)-objs += qat_crypt.o
|
|
|
|
# Suppress incorrect warnings from versions of objtool which are not
|
|
# aware of x86 EVEX prefix instructions used for AVX512.
|
|
OBJECT_FILES_NON_STANDARD_vdev_raidz_math_avx512bw.o := y
|
|
OBJECT_FILES_NON_STANDARD_vdev_raidz_math_avx512f.o := y
|
|
|
|
$(MODULE)-$(CONFIG_X86) += vdev_raidz_math_sse2.o
|
|
$(MODULE)-$(CONFIG_X86) += vdev_raidz_math_ssse3.o
|
|
$(MODULE)-$(CONFIG_X86) += vdev_raidz_math_avx2.o
|
|
$(MODULE)-$(CONFIG_X86) += vdev_raidz_math_avx512f.o
|
|
$(MODULE)-$(CONFIG_X86) += vdev_raidz_math_avx512bw.o
|
|
|
|
$(MODULE)-$(CONFIG_ARM64) += vdev_raidz_math_aarch64_neon.o
|
|
$(MODULE)-$(CONFIG_ARM64) += vdev_raidz_math_aarch64_neonx2.o
|