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/sys/metaslab_impl.h
          +++ new/usr/src/uts/common/fs/zfs/sys/metaslab_impl.h
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26   26  /*
  27      - * Copyright (c) 2012 by Delphix. All rights reserved.
       27 + * Copyright (c) 2013 by Delphix. All rights reserved.
  28   28   */
  29   29  
  30   30  #ifndef _SYS_METASLAB_IMPL_H
  31   31  #define _SYS_METASLAB_IMPL_H
  32   32  
  33   33  #include <sys/metaslab.h>
  34   34  #include <sys/space_map.h>
  35   35  #include <sys/vdev.h>
  36   36  #include <sys/txg.h>
  37   37  #include <sys/avl.h>
  38   38  
  39   39  #ifdef  __cplusplus
  40   40  extern "C" {
  41   41  #endif
  42   42  
  43   43  struct metaslab_class {
  44   44          spa_t                   *mc_spa;
  45   45          metaslab_group_t        *mc_rotor;
  46   46          space_map_ops_t         *mc_ops;
  47   47          uint64_t                mc_aliquot;
       48 +        uint64_t                mc_alloc_groups; /* # of allocatable groups */
  48   49          uint64_t                mc_alloc;       /* total allocated space */
  49   50          uint64_t                mc_deferred;    /* total deferred frees */
  50   51          uint64_t                mc_space;       /* total space (alloc + free) */
  51   52          uint64_t                mc_dspace;      /* total deflated space */
  52   53  };
  53   54  
  54   55  struct metaslab_group {
  55   56          kmutex_t                mg_lock;
  56   57          avl_tree_t              mg_metaslab_tree;
  57   58          uint64_t                mg_aliquot;
  58   59          uint64_t                mg_bonus_area;
  59   60          uint64_t                mg_alloc_failures;
       61 +        boolean_t               mg_allocatable;         /* can we allocate? */
       62 +        uint64_t                mg_free_capacity;       /* percentage free */
  60   63          int64_t                 mg_bias;
  61   64          int64_t                 mg_activation_count;
  62   65          metaslab_class_t        *mg_class;
  63   66          vdev_t                  *mg_vd;
  64   67          metaslab_group_t        *mg_prev;
  65   68          metaslab_group_t        *mg_next;
  66   69  };
  67   70  
  68   71  /*
  69   72   * Each metaslab maintains an in-core free map (ms_map) that contains the
↓ open down ↓ 43 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX