]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFV r336946: 9238 ZFS Spacemap Encoding V2
authorAlexander Motin <mav@FreeBSD.org>
Mon, 30 Jul 2018 23:47:38 +0000 (23:47 +0000)
committerAlexander Motin <mav@FreeBSD.org>
Mon, 30 Jul 2018 23:47:38 +0000 (23:47 +0000)
commit6413a6d31fca6e8e41b23cff075525eca2d73749
treefaacc7b91bd0755189a1b73542ecd32ac6feecce
parent1960706625f2e2232e6db2ba507e943a2847ef54
parentaf8040b47abe8068cc655c0ef5f1292165dcc6d0
MFV r336946: 9238 ZFS Spacemap Encoding V2

The current space map encoding has the following disadvantages:
[1] Assuming 512 sector size each entry can represent at most 16MB for a segment.
This makes the encoding very inefficient for large regions of space.
[2] As vdev-wide space maps have started to be used by new features (i.e.
device removal, zpool checkpoint) we've started imposing limits in the
vdevs that can be used with them based on the maximum addressable offset
(currently 64PB for a top-level vdev).

The new remains backwards compatible with the old one. The introduced
two-word entry format, besides extending the limits imposed by the single-entry
layout, also includes a vdev field and some extra padding after its prefix.

The extra padding after the prefix should is reserved for future usage (e.g.
new prefixes for future encodings or new fields for flags). The new vdev field
not only makes the space maps more self-descriptive, but also opens the doors
for pool-wide space maps.

One final important note is that the number of bits used for vdevs is reduced
to 24 bits for blkptrs. That was decided as we don't know of any setups that
use more than 16M vdevs for the time being and
we wanted to fit the vdev field in the space map. In addition that gives us
some extra bits in dva_t.

illumos/illumos-gate@17f11284b49b98353b5119463254074fd9bc0a28

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@zfsmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
13 files changed:
cddl/contrib/opensolaris/cmd/zdb/zdb.c
cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
cddl/contrib/opensolaris/cmd/ztest/ztest.c
sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_checkpoint.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c