Why not just dd a file to a scratch dataset (with no compression, copies=3,
a suitable quota to prevent filling, and whatever other properties you
think might be relevant).

The use case is legitimate, but the need for more code to address it seems
dubious.

On Sat., 10 Mar. 2018, 13:11 George Wilson, <[email protected]>
wrote:

> Reviewed by: John Wren Kennedy [email protected]
> Reviewed by: Matthew Ahrens [email protected]
> Reviewed by: Pavel Zakharov [email protected]
> Reviewed by: Prakash Surya [email protected]
> PROBLEM
>
> The first access to a block incurs a performance penalty on some platforms
> (e.g. AWS's EBS, VMware VMDKs). Therefore we recommend that volumes are
> "thick
> provisioned", where supported by the platform (VMware). This can create a
> large
> delay in getting a new virtual machines up and running (or adding storage
> to
> an existing Engine). If the thick provision step is omitted, write
> performance
> will be suboptimal until all blocks on the LUN have been written.
> SOLUTION
>
> This feature introduces a way to 'initialize' the disks at install or in
> the
> background to make sure we don't incur this first read penalty.
>
> When an entire LUN is added to ZFS, we make all space available
> immediately,
> and allow ZFS to find unallocated space and zero it out. This works with
> concurrent writes to arbitrary offsets, ensuring that we don't zero out
> something that has been (or is in the middle of being) written. This scheme
> can also be applied to existing pools (affecting only free regions on the
> vdev). Detailed design:
> - new subcommand:zpool initialize [-cs] [ ...]
> - start, suspend, or cancel initialization
> - Creates new open-context thread for each vdev
> - Thread iterates through all metaslabs in this vdev
> - Each metaslab:
> - select a metaslab
> - load the metaslab
> - mark the metaslab as being zeroed
> - walk all free ranges within that metaslab and translate them
> to ranges on the leaf vdev
> - issue a "zeroing" I/O on the leaf vdev that corresponds to a
> free range on the metaslab we're working on
> - continue until all free ranges for this metaslab have been
> "zeroed"
> - reset/unmark the metaslab being zeroed
> - if more metaslabs exist, then repeat above tasks.
> - if no more metaslabs, then we're done.
>
>     - progress for the initialization is stored on-disk in the vdev’s leaf
>       zap object. The following information is stored:
>             - the last offset that has been initialized
>             - the state of the initialization process (i.e. active,
>               suspended, or canceled)
>             - the start time for the initialization
>
>     - progress is reported via the zpool status command and shows
>       information for each of the videos that are initializing
>
> ------------------------------
> You can view, comment on, or merge this pull request online at:
>
>   https://github.com/openzfs/openzfs/pull/586
> Commit Summary
>
>    - 9102 zfs should be able to initialize storage devices
>
> File Changes
>
>    - *M* usr/src/cmd/truss/codes.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-0> (4)
>    - *M* usr/src/cmd/zpool/zpool_main.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-1> (156)
>    - *M* usr/src/cmd/ztest/ztest.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-2> (98)
>    - *M* usr/src/lib/libzfs/common/libzfs.h
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-3> (5)
>    - *M* usr/src/lib/libzfs/common/libzfs_pool.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-4> (94)
>    - *M* usr/src/lib/libzfs/common/libzfs_util.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-5> (9)
>    - *M* usr/src/lib/libzfs/common/mapfile-vers
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-6> (1)
>    - *M* usr/src/lib/libzfs_core/common/libzfs_core.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-7> (37)
>    - *M* usr/src/lib/libzfs_core/common/libzfs_core.h
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-8> (4)
>    - *M* usr/src/lib/libzfs_core/common/mapfile-vers
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-9> (6)
>    - *M* usr/src/lib/libzpool/common/llib-lzpool
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-10> (3)
>    - *M* usr/src/man/man1m/zpool.1m
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-11> (31)
>    - *M* usr/src/pkg/manifests/system-test-zfstest.mf
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-12> (39)
>    - *M* usr/src/test/zfs-tests/include/commands.cfg
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-13> (1)
>    - *M* usr/src/test/zfs-tests/runfiles/delphix.run
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-14> (13)
>    - *A*
>    usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-15> (21)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/cleanup.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-16> (31)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize.kshlib
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-17> (43)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_attach_detach_add_remove.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-18> (68)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_import_export.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-19> (78)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_offline_export_import_online.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-20> (66)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_online_offline.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-21> (74)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_split.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-22> (64)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_neg.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-23> (60)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_pos.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-24> (52)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_suspend_resume.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-25> (63)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_unsupported_vdevs.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-26> (74)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_checksums.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-27> (59)
>    - *A*
>    
> usr/src/test/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized.ksh
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-28> (88)
>    - *M* usr/src/uts/common/Makefile.files
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-29> (1)
>    - *M* usr/src/uts/common/fs/zfs/metaslab.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-30> (36)
>    - *M* usr/src/uts/common/fs/zfs/spa.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-31> (158)
>    - *M* usr/src/uts/common/fs/zfs/spa_misc.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-32> (7)
>    - *M* usr/src/uts/common/fs/zfs/sys/metaslab_impl.h
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-33> (12)
>    - *M* usr/src/uts/common/fs/zfs/sys/range_tree.h
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-34> (2)
>    - *M* usr/src/uts/common/fs/zfs/sys/spa.h
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-35> (2)
>    - *M* usr/src/uts/common/fs/zfs/sys/vdev_impl.h
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-36> (33)
>    - *A* usr/src/uts/common/fs/zfs/sys/vdev_initialize.h
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-37> (46)
>    - *M* usr/src/uts/common/fs/zfs/sys/zio_priority.h
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-38> (3)
>    - *M* usr/src/uts/common/fs/zfs/vdev.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-39> (44)
>    - *M* usr/src/uts/common/fs/zfs/vdev_disk.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-40> (1)
>    - *M* usr/src/uts/common/fs/zfs/vdev_file.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-41> (4)
>    - *M* usr/src/uts/common/fs/zfs/vdev_indirect.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-42> (1)
>    - *A* usr/src/uts/common/fs/zfs/vdev_initialize.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-43> (790)
>    - *M* usr/src/uts/common/fs/zfs/vdev_mirror.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-44> (5)
>    - *M* usr/src/uts/common/fs/zfs/vdev_missing.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-45> (4)
>    - *M* usr/src/uts/common/fs/zfs/vdev_queue.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-46> (16)
>    - *M* usr/src/uts/common/fs/zfs/vdev_raidz.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-47> (75)
>    - *M* usr/src/uts/common/fs/zfs/vdev_removal.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-48> (17)
>    - *M* usr/src/uts/common/fs/zfs/vdev_root.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-49> (3)
>    - *M* usr/src/uts/common/fs/zfs/zfs_ioctl.c
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-50> (80)
>    - *M* usr/src/uts/common/sys/fs/zfs.h
>    <https://github.com/openzfs/openzfs/pull/586/files#diff-51> (35)
>
> Patch Links:
>
>    - https://github.com/openzfs/openzfs/pull/586.patch
>    - https://github.com/openzfs/openzfs/pull/586.diff
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/openzfs/openzfs/pull/586>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AK9maSWUM1zuLaqeJWz4BRyh3Q0W0dEuks5tczZcgaJpZM4SlGLZ>
> .
>


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/586#issuecomment-372010284
------------------------------------------
openzfs: openzfs-developer
Permalink: 
https://openzfs.topicbox.com/groups/developer/discussions/T6777d2c2033b2134-M0d42938d76cccb8e0d08cd09
Delivery options: https://openzfs.topicbox.com/groups

Reply via email to