From e022864d19ee124c88f6fb9018e4b2d2cec76a08 Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Wed, 17 Sep 2014 08:59:43 +0200 Subject: Illumos 5176 - lock contention on godfather zio 5176 lock contention on godfather zio Reviewed by: Adam Leventhal Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Richard Elling Reviewed by: Bayard Bell Approved by: Garrett D'Amore References: https://www.illumos.org/issues/5176 https://github.com/illumos/illumos-gate/commit/6f834bc Porting notes: Under Linux max_ncpus is defined as num_possible_cpus(). This is largest number of cpu ids which might be available during the life time of the system boot. This value can be larger than the number of present cpus if CONFIG_HOTPLUG_CPU is defined. Ported by: Turbo Fredriksson Signed-off-by: Brian Behlendorf Closes #2711 --- cmd/zdb/zdb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cmd/zdb') diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 4b6e73e20..5f9770984 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -2565,7 +2565,7 @@ dump_block_stats(spa_t *spa) uint64_t norm_alloc, norm_space, total_alloc, total_found; int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD; boolean_t leaks = B_FALSE; - int e; + int e, c; bp_embedded_type_t i; (void) printf("\nTraversing all blocks %s%s%s%s%s...\n\n", @@ -2614,10 +2614,12 @@ dump_block_stats(spa_t *spa) * all async I/Os to complete. */ if (dump_opt['c']) { - (void) zio_wait(spa->spa_async_zio_root); - spa->spa_async_zio_root = zio_root(spa, NULL, NULL, - ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | - ZIO_FLAG_GODFATHER); + for (c = 0; c < max_ncpus; c++) { + (void) zio_wait(spa->spa_async_zio_root[c]); + spa->spa_async_zio_root[c] = zio_root(spa, NULL, NULL, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | + ZIO_FLAG_GODFATHER); + } } if (zcb.zcb_haderrors) { -- cgit v1.2.3