# HG changeset patch # User George Wilson # Date 1327373248 28800 # Node ID 85c66b89d5f2666e7b22da485bcfa90887a6679c # Parent a5771a96228c0535af3ac933ad51040f77451449 1909 disk sync write perf regression when slog is used post oi_148 Reviewed by: Matt Ahrens Reviewed by: Eric Schrock Reviewed by: Robert Mustacchi Reviewed by: Bill Pijewski Reviewed by: Richard Elling Reviewed by: Steve Gonczi Reviewed by: Garrett D'Amore Reviewed by: Dan McDonald Reviewed by: Albert Lee Approved by: Eric Schrock diff -r a5771a96228c -r 85c66b89d5f2 usr/src/uts/common/fs/zfs/metaslab.c --- a/usr/src/uts/common/fs/zfs/metaslab.c Mon Jan 23 18:43:32 2012 -0800 +++ b/usr/src/uts/common/fs/zfs/metaslab.c Mon Jan 23 18:47:28 2012 -0800 @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -36,7 +36,7 @@ * avoid having to load lots of space_maps in a given txg. There are, * however, some cases where we want to avoid "fast" ganging and instead * we want to do an exhaustive search of all metaslabs on this device. - * Currently we don't allow any gang or dump device related allocations + * Currently we don't allow any gang, zil, or dump device related allocations * to "fast" gang. */ #define CAN_FASTGANG(flags) \ diff -r a5771a96228c -r 85c66b89d5f2 usr/src/uts/common/fs/zfs/zio.c --- a/usr/src/uts/common/fs/zfs/zio.c Mon Jan 23 18:43:32 2012 -0800 +++ b/usr/src/uts/common/fs/zfs/zio.c Mon Jan 23 18:47:28 2012 -0800 @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved. */ @@ -2219,13 +2219,22 @@ ASSERT(txg > spa_syncing_txg(spa)); - if (use_slog) + /* + * ZIL blocks are always contiguous (i.e. not gang blocks) so we + * set the METASLAB_GANG_AVOID flag so that they don't "fast gang" + * when allocating them. + */ + if (use_slog) { error = metaslab_alloc(spa, spa_log_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); - - if (error) + new_bp, 1, txg, old_bp, + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID); + } + + if (error) { error = metaslab_alloc(spa, spa_normal_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + new_bp, 1, txg, old_bp, + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID); + } if (error == 0) { BP_SET_LSIZE(new_bp, size);