Skip to content
This repository
Browse code

Illumos #1909: disk sync write perf regression when slog is used post…

… oi_148

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Bill Pijewski <wdp@joyent.com>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Reviewed by: Steve Gonczi <gonczi@comcast.net>
Reviewed by: Garrett D'Amore <garrett.damore@gmail.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Reviewed by: Albert Lee <trisk@nexenta.com>
Approved by: Eric Schrock <eric.schrock@delphix.com>

Refererces to Illumos issue:
  https://www.illumos.org/issues/1909

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #680
  • Loading branch information...
commit ebf8e3a237d4720e3a85fb3a168917ead4ba25d1 1 parent 409dc1a
Brian Behlendorf behlendorf authored

Showing 2 changed files with 16 additions and 7 deletions. Show diff stats Hide diff stats

  1. +2 2 module/zfs/metaslab.c
  2. +14 5 module/zfs/zio.c
4 module/zfs/metaslab.c
@@ -20,7 +20,7 @@
20 20 */
21 21 /*
22 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23   - * Copyright (c) 2011 by Delphix. All rights reserved.
  23 + * Copyright (c) 2012 by Delphix. All rights reserved.
24 24 */
25 25
26 26 #include <sys/zfs_context.h>
@@ -38,7 +38,7 @@
38 38 * avoid having to load lots of space_maps in a given txg. There are,
39 39 * however, some cases where we want to avoid "fast" ganging and instead
40 40 * we want to do an exhaustive search of all metaslabs on this device.
41   - * Currently we don't allow any gang or dump device related allocations
  41 + * Currently we don't allow any gang, zil, or dump device related allocations
42 42 * to "fast" gang.
43 43 */
44 44 #define CAN_FASTGANG(flags) \
19 module/zfs/zio.c
@@ -20,7 +20,7 @@
20 20 */
21 21 /*
22 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23   - * Copyright (c) 2011 by Delphix. All rights reserved.
  23 + * Copyright (c) 2012 by Delphix. All rights reserved.
24 24 * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
25 25 */
26 26
@@ -2317,13 +2317,22 @@ zio_alloc_zil(spa_t *spa, uint64_t txg, blkptr_t *new_bp, blkptr_t *old_bp,
2317 2317
2318 2318 ASSERT(txg > spa_syncing_txg(spa));
2319 2319
2320   - if (use_slog)
  2320 + /*
  2321 + * ZIL blocks are always contiguous (i.e. not gang blocks) so we
  2322 + * set the METASLAB_GANG_AVOID flag so that they don't "fast gang"
  2323 + * when allocating them.
  2324 + */
  2325 + if (use_slog) {
2321 2326 error = metaslab_alloc(spa, spa_log_class(spa), size,
2322   - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID);
  2327 + new_bp, 1, txg, old_bp,
  2328 + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID);
  2329 + }
2323 2330
2324   - if (error)
  2331 + if (error) {
2325 2332 error = metaslab_alloc(spa, spa_normal_class(spa), size,
2326   - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID);
  2333 + new_bp, 1, txg, old_bp,
  2334 + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID);
  2335 + }
2327 2336
2328 2337 if (error == 0) {
2329 2338 BP_SET_LSIZE(new_bp, size);

0 comments on commit ebf8e3a

Please sign in to comment.
Something went wrong with that request. Please try again.