]> git.proxmox.com Git - mirror_zfs.git/commit
spa_load_verify() may consume too much memory
authorGeorge Wilson <george.wilson@delphix.com>
Tue, 13 Aug 2019 14:11:57 +0000 (08:11 -0600)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 13 Aug 2019 14:11:57 +0000 (08:11 -0600)
commitc8242a96ba8495013cc2f2e12ea6202e61796462
tree89367092fe6fde1942c7cf6d05721ce40807e3fc
parenta43570c5f3ca11957c23b4e073a520963cd9cfb2
spa_load_verify() may consume too much memory

When a pool is imported it will scan the pool to verify the integrity
of the data and metadata. The amount it scans will depend on the
import flags provided. On systems with small amounts of memory or
when importing a pool from the crash kernel, it's possible for
spa_load_verify to issue too many I/Os that it consumes all the memory
of the system resulting in an OOM message or a hang.

To prevent this, we limit the amount of memory that the initial pool
scan can consume. This change will, by default, use 1/16th of the ARC
for scan I/Os to prevent running the system out of memory during import.

Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Signed-off-by: George Wilson george.wilson@delphix.com
External-issue: DLPX-65237
External-issue: DLPX-65238
Closes #9146
cmd/zdb/zdb.c
include/sys/spa_impl.h
man/man5/zfs-module-parameters.5
module/zfs/spa.c