Print this page
3954 metaslabs continue to load even after hitting zfs_mg_alloc_failure limit
4080 zpool clear fails to clear pool
4081 need zfs_mg_noalloc_threshold
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zio.c
          +++ new/usr/src/uts/common/fs/zfs/zio.c
↓ open down ↓ 163 lines elided ↑ open up ↑
 164  164  
 165  165                  ASSERT(zio_data_buf_cache[c] != NULL);
 166  166                  if (zio_data_buf_cache[c - 1] == NULL)
 167  167                          zio_data_buf_cache[c - 1] = zio_data_buf_cache[c];
 168  168          }
 169  169  
 170  170          /*
 171  171           * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs
 172  172           * to fail 3 times per txg or 8 failures, whichever is greater.
 173  173           */
 174      -        zfs_mg_alloc_failures = MAX((3 * max_ncpus / 2), 8);
      174 +        if (zfs_mg_alloc_failures == 0)
      175 +                zfs_mg_alloc_failures = MAX((3 * max_ncpus / 2), 8);
 175  176  
 176  177          zio_inject_init();
 177  178  }
 178  179  
 179  180  void
 180  181  zio_fini(void)
 181  182  {
 182  183          size_t c;
 183  184          kmem_cache_t *last_cache = NULL;
 184  185          kmem_cache_t *last_data_cache = NULL;
↓ open down ↓ 2173 lines elided ↑ open up ↑
2358 2359           */
2359 2360          if (use_slog) {
2360 2361                  error = metaslab_alloc(spa, spa_log_class(spa), size,
2361 2362                      new_bp, 1, txg, old_bp,
2362 2363                      METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID);
2363 2364          }
2364 2365  
2365 2366          if (error) {
2366 2367                  error = metaslab_alloc(spa, spa_normal_class(spa), size,
2367 2368                      new_bp, 1, txg, old_bp,
2368      -                    METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID);
     2369 +                    METASLAB_HINTBP_AVOID);
2369 2370          }
2370 2371  
2371 2372          if (error == 0) {
2372 2373                  BP_SET_LSIZE(new_bp, size);
2373 2374                  BP_SET_PSIZE(new_bp, size);
2374 2375                  BP_SET_COMPRESS(new_bp, ZIO_COMPRESS_OFF);
2375 2376                  BP_SET_CHECKSUM(new_bp,
2376 2377                      spa_version(spa) >= SPA_VERSION_SLIM_ZIL
2377 2378                      ? ZIO_CHECKSUM_ZILOG2 : ZIO_CHECKSUM_ZILOG);
2378 2379                  BP_SET_TYPE(new_bp, DMU_OT_INTENT_LOG);
↓ open down ↓ 798 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX