summaryrefslogtreecommitdiffstats
path: root/module/zfs/zio.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2012-04-19 15:55:28 -0700
committerBrian Behlendorf <[email protected]>2012-04-19 16:26:29 -0700
commitebf8e3a237d4720e3a85fb3a168917ead4ba25d1 (patch)
treea6b6db60ee0059096ba7a885d7e48dc41df0d7ae /module/zfs/zio.c
parent409dc1a570a836737b2a5bb43658cdde703c935e (diff)
Illumos #1909: disk sync write perf regression when slog is used post oi_148
Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Eric Schrock <[email protected]> Reviewed by: Robert Mustacchi <[email protected]> Reviewed by: Bill Pijewski <[email protected]> Reviewed by: Richard Elling <[email protected]> Reviewed by: Steve Gonczi <[email protected]> Reviewed by: Garrett D'Amore <[email protected]> Reviewed by: Dan McDonald <[email protected]> Reviewed by: Albert Lee <[email protected]> Approved by: Eric Schrock <[email protected]> Refererces to Illumos issue: https://www.illumos.org/issues/1909 Signed-off-by: Brian Behlendorf <[email protected]> Closes #680
Diffstat (limited to 'module/zfs/zio.c')
-rw-r--r--module/zfs/zio.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/module/zfs/zio.c b/module/zfs/zio.c
index 149088d93..206ed9a93 100644
--- a/module/zfs/zio.c
+++ b/module/zfs/zio.c
@@ -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.
*/
@@ -2317,13 +2317,22 @@ zio_alloc_zil(spa_t *spa, uint64_t txg, blkptr_t *new_bp, blkptr_t *old_bp,
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);
+ new_bp, 1, txg, old_bp,
+ METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID);
+ }
- if (error)
+ 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);