]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/spa.c
Make metaslab class rotor and aliquot per-allocator.
authorAlexander Motin <mav@FreeBSD.org>
Tue, 15 Dec 2020 18:55:44 +0000 (13:55 -0500)
committerGitHub <noreply@github.com>
Tue, 15 Dec 2020 18:55:44 +0000 (10:55 -0800)
commitf8020c936356b887ab1e03eba1a723f9dfda6eea
treef58ab8f7b84363d1e58d014d2c4b15a3b468efbe
parente2d952cda06a649441eba01730753e1a24bf2c83
Make metaslab class rotor and aliquot per-allocator.

Metaslab rotor and aliquot are used to distribute workload between
vdevs while keeping some locality for logically adjacent blocks.  Once
multiple allocators were introduced to separate allocation of different
objects it does not make much sense for different allocators to write
into different metaslabs of the same metaslab group (vdev) same time,
competing for its resources.  This change makes each allocator choose
metaslab group independently, colliding with others only sporadically.

Test including simultaneous write into 4 files with recordsize of 4KB
on a striped pool of 30 disks on a system with 40 logical cores show
reduction of vdev queue lock contention from 54 to 27% due to better
load distribution.  Unfortunately it won't help much ZVOLs yet since
only one dataset/ZVOL is synced at a time, and so for the most part
only one allocator is used, but it may improve later.

While there, to reduce the number of pointer dereferences change
per-allocator storage for metaslab classes and groups from several
separate malloc()'s to variable length arrays at the ends of the
original class and group structures.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Closes #11288
cmd/zdb/zdb.c
cmd/ztest/ztest.c
include/sys/metaslab_impl.h
module/zfs/metaslab.c
module/zfs/spa.c
module/zfs/spa_misc.c
module/zfs/zio.c