@@ -146,7 +146,7 @@ static uint_t zfs_mg_fragmentation_threshold = 95;
146
146
* active metaslab that exceeds this threshold will no longer keep its active
147
147
* status allowing better metaslabs to be selected.
148
148
*/
149
- static uint_t zfs_metaslab_fragmentation_threshold = 70 ;
149
+ static uint_t zfs_metaslab_fragmentation_threshold = 85 ;
150
150
151
151
/*
152
152
* When set will load all metaslabs when pool is first opened.
@@ -2889,8 +2889,6 @@ metaslab_fini(metaslab_t *msp)
2889
2889
kmem_free (msp , sizeof (metaslab_t ));
2890
2890
}
2891
2891
2892
- #define FRAGMENTATION_TABLE_SIZE 17
2893
-
2894
2892
/*
2895
2893
* This table defines a segment size based fragmentation metric that will
2896
2894
* allow each metaslab to derive its own fragmentation value. This is done
@@ -2901,33 +2899,41 @@ metaslab_fini(metaslab_t *msp)
2901
2899
* us the fragmentation metric. This means that a high fragmentation metric
2902
2900
* equates to most of the free space being comprised of small segments.
2903
2901
* Conversely, if the metric is low, then most of the free space is in
2904
- * large segments. A 10% change in fragmentation equates to approximately
2905
- * double the number of segments.
2902
+ * large segments.
2906
2903
*
2907
- * This table defines 0% fragmented space using 16MB segments. Testing has
2908
- * shown that segments that are greater than or equal to 16MB do not suffer
2909
- * from drastic performance problems. Using this value, we derive the rest
2910
- * of the table. Since the fragmentation value is never stored on disk, it
2911
- * is possible to change these calculations in the future.
2904
+ * This table defines 0% fragmented space using 1G segments. Using this value,
2905
+ * we derive the rest of the table. This table originally went up to 16MB, but
2906
+ * with larger recordsizes, larger ashifts, and use of raidz3, it is possible
2907
+ * to have significantly larger allocations than were previously possible.
2908
+ * Since the fragmentation value is never stored on disk, it is possible to
2909
+ * change these calculations in the future.
2912
2910
*/
2913
- static const int zfs_frag_table [FRAGMENTATION_TABLE_SIZE ] = {
2911
+ static const int zfs_frag_table [] = {
2914
2912
100 , /* 512B */
2915
2913
100 , /* 1K */
2916
2914
98 , /* 2K */
2917
2915
95 , /* 4K */
2918
- 90 , /* 8K */
2919
- 80 , /* 16K */
2920
- 70 , /* 32K */
2921
- 60 , /* 64K */
2922
- 50 , /* 128K */
2923
- 40 , /* 256K */
2924
- 30 , /* 512K */
2925
- 20 , /* 1M */
2926
- 15 , /* 2M */
2927
- 10 , /* 4M */
2928
- 5 , /* 8M */
2929
- 0 /* 16M */
2916
+ 92 , /* 8K */
2917
+ 90 , /* 16K */
2918
+ 85 , /* 32K */
2919
+ 80 , /* 64K */
2920
+ 75 , /* 128K */
2921
+ 70 , /* 256K */
2922
+ 60 , /* 512K */
2923
+ 50 , /* 1M */
2924
+ 40 , /* 2M */
2925
+ 35 , /* 4M */
2926
+ 30 , /* 8M */
2927
+ 25 , /* 16M */
2928
+ 20 , /* 32M */
2929
+ 15 , /* 64M */
2930
+ 10 , /* 128M */
2931
+ 5 , /* 256M */
2932
+ 2 , /* 512M */
2933
+ 0 , /* 1G */
2930
2934
};
2935
+ #define FRAGMENTATION_TABLE_SIZE \
2936
+ (sizeof (zfs_frag_table)/(sizeof (zfs_frag_table[0])))
2931
2937
2932
2938
/*
2933
2939
* Calculate the metaslab's fragmentation metric and set ms_fragmentation.
0 commit comments