From owner-svn-src-stable-10@FreeBSD.ORG Thu Oct 23 01:36:44 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A660DAEA; Thu, 23 Oct 2014 01:36:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90E34F6; Thu, 23 Oct 2014 01:36:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9N1aiZd004353; Thu, 23 Oct 2014 01:36:44 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9N1aihu004352; Thu, 23 Oct 2014 01:36:44 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410230136.s9N1aihu004352@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 23 Oct 2014 01:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273508 - stable/10/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2014 01:36:44 -0000 Author: delphij Date: Thu Oct 23 01:36:43 2014 New Revision: 273508 URL: https://svnweb.freebsd.org/changeset/base/273508 Log: MFC r272806: MFV r272802: - Limit ARC for zdb at 256MB. zdb do not typically revisit data in the ARC. - Increase default max_inflight from 200 to 1000 (can be overriden by -I) so we can queue more I/Os when doing scrubbing. - Print status while loading meataslabs for leak detection. Illumos issues: 5169 zdb should limit its ARC size 5170 zdb -c should create more scrub i/os by default 5171 zdb should print status while loading metaslabs for leak detection Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Oct 23 01:22:29 2014 (r273507) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Oct 23 01:36:43 2014 (r273508) @@ -76,8 +76,10 @@ #ifndef lint extern boolean_t zfs_recover; +extern uint64_t zfs_arc_max, zfs_arc_meta_limit; #else boolean_t zfs_recover; +uint64_t zfs_arc_max, zfs_arc_meta_limit; #endif const char cmdname[] = "zdb"; @@ -89,7 +91,7 @@ extern void dump_intent_log(zilog_t *); uint64_t *zopt_object = NULL; int zopt_objects = 0; libzfs_handle_t *g_zfs; -uint64_t max_inflight = 200; +uint64_t max_inflight = 1000; /* * These libumem hooks provide a reasonable set of defaults for the allocator's @@ -2382,7 +2384,7 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog zcb->zcb_readfails = 0; - if (dump_opt['b'] < 5 && isatty(STDERR_FILENO) && + if (dump_opt['b'] < 5 && gethrtime() > zcb->zcb_lastprint + NANOSEC) { uint64_t now = gethrtime(); char buf[10]; @@ -2467,9 +2469,9 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) if (!dump_opt['L']) { vdev_t *rvd = spa->spa_root_vdev; - for (int c = 0; c < rvd->vdev_children; c++) { + for (uint64_t c = 0; c < rvd->vdev_children; c++) { vdev_t *vd = rvd->vdev_child[c]; - for (int m = 0; m < vd->vdev_ms_count; m++) { + for (uint64_t m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); metaslab_unload(msp); @@ -2482,6 +2484,15 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) * interfaces. */ if (msp->ms_sm != NULL) { + (void) fprintf(stderr, + "\rloading space map for " + "vdev %llu of %llu, " + "metaslab %llu of %llu ...", + (longlong_t)c, + (longlong_t)rvd->vdev_children, + (longlong_t)m, + (longlong_t)vd->vdev_ms_count); + msp->ms_ops = &zdb_metaslab_ops; VERIFY0(space_map_load(msp->ms_sm, msp->ms_tree, SM_ALLOC)); @@ -2490,6 +2501,7 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) mutex_exit(&msp->ms_lock); } } + (void) fprintf(stderr, "\n"); } spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER); @@ -3490,6 +3502,12 @@ main(int argc, char **argv) usage(); } + /* + * ZDB does not typically re-read blocks; therefore limit the ARC + * to 256 MB, which can be used entirely for metadata. + */ + zfs_arc_max = zfs_arc_meta_limit = 256 * 1024 * 1024; + kernel_init(FREAD); g_zfs = libzfs_init(); ASSERT(g_zfs != NULL);