Illumos 6251 - add tunable to disable free_bpobj processing

6251 - add tunable to disable free_bpobj processing
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Simon Klinkert <simon.klinkert@gmail.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Albert Lee <trisk@omniti.com>
Reviewed by: Xin Li <delphij@freebsd.org>
Approved by: Garrett D'Amore <garrett@damore.org>

References:
  https://www.illumos.org/issues/6251
  https://github.com/illumos/illumos-gate/commit/139510f

Porting notes:
- Added as module option declaration.
- Added to zfs-module-parameters.5 man page.

Ported-by: Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
George Wilson 2016-01-22 16:41:02 -08:00 committed by Brian Behlendorf
parent 0a1f8cd999
commit ba5ad9a48d
2 changed files with 22 additions and 2 deletions

View File

@ -784,6 +784,17 @@ Start syncing out a transaction group if there is at least this much dirty data.
Default value: \fB67,108,864\fR. Default value: \fB67,108,864\fR.
.RE .RE
.sp
.ne 2
.na
\fBzfs_free_bpobj_enabled\fR (int)
.ad
.RS 12n
Enable/disable the processing of the free_bpobj object.
.sp
Default value: \fB1\fR.
.RE
.sp .sp
.ne 2 .ne 2
.na .na

View File

@ -20,7 +20,7 @@
*/ */
/* /*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
*/ */
#include <sys/dsl_scan.h> #include <sys/dsl_scan.h>
@ -76,6 +76,11 @@ ulong zfs_free_max_blocks = 100000;
((scn)->scn_phys.scn_func == POOL_SCAN_SCRUB || \ ((scn)->scn_phys.scn_func == POOL_SCAN_SCRUB || \
(scn)->scn_phys.scn_func == POOL_SCAN_RESILVER) (scn)->scn_phys.scn_func == POOL_SCAN_RESILVER)
/*
* Enable/disable the processing of the free_bpobj object.
*/
int zfs_free_bpobj_enabled = 1;
/* the order has to match pool_scan_type */ /* the order has to match pool_scan_type */
static scan_cb_t *scan_funcs[POOL_SCAN_FUNCS] = { static scan_cb_t *scan_funcs[POOL_SCAN_FUNCS] = {
NULL, NULL,
@ -1502,7 +1507,8 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx)
* have to worry about traversing it. It is also faster to free the * have to worry about traversing it. It is also faster to free the
* blocks than to scrub them. * blocks than to scrub them.
*/ */
if (spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) { if (zfs_free_bpobj_enabled &&
spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) {
scn->scn_is_bptree = B_FALSE; scn->scn_is_bptree = B_FALSE;
scn->scn_zio_root = zio_root(dp->dp_spa, NULL, scn->scn_zio_root = zio_root(dp->dp_spa, NULL,
NULL, ZIO_FLAG_MUSTSUCCEED); NULL, ZIO_FLAG_MUSTSUCCEED);
@ -1918,4 +1924,7 @@ MODULE_PARM_DESC(zfs_no_scrub_prefetch, "Set to disable scrub prefetching");
module_param(zfs_free_max_blocks, ulong, 0644); module_param(zfs_free_max_blocks, ulong, 0644);
MODULE_PARM_DESC(zfs_free_max_blocks, "Max number of blocks freed in one txg"); MODULE_PARM_DESC(zfs_free_max_blocks, "Max number of blocks freed in one txg");
module_param(zfs_free_bpobj_enabled, int, 0644);
MODULE_PARM_DESC(zfs_free_bpobj_enabled, "Enable processing of the free_bpobj");
#endif #endif