40
40
* avoid having to load lots of space_maps in a given txg. There are,
41
41
* however, some cases where we want to avoid "fast" ganging and instead
42
42
* we want to do an exhaustive search of all metaslabs on this device.
43
- * Currently we don't allow any gang, zil , or dump device related allocations
43
+ * Currently we don't allow any gang, slog , or dump device related allocations
44
44
* to "fast" gang.
45
45
*/
46
46
#define CAN_FASTGANG (flags ) \
@@ -63,14 +63,6 @@ uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */
63
63
*/
64
64
int zfs_condense_pct = 200 ;
65
65
66
- /*
67
- * This value defines the number of allowed allocation failures per vdev.
68
- * If a device reaches this threshold in a given txg then we consider skipping
69
- * allocations on that device. The value of zfs_mg_alloc_failures is computed
70
- * in zio_init() unless it has been overridden in /etc/system.
71
- */
72
- int zfs_mg_alloc_failures = 0 ;
73
-
74
66
/*
75
67
* The zfs_mg_noalloc_threshold defines which metaslab groups should
76
68
* be eligible for allocation. The value is defined as a percentage of
@@ -1660,10 +1652,7 @@ metaslab_sync_done(metaslab_t *msp, uint64_t txg)
1660
1652
void
1661
1653
metaslab_sync_reassess (metaslab_group_t * mg )
1662
1654
{
1663
- int64_t failures = mg -> mg_alloc_failures ;
1664
-
1665
1655
metaslab_group_alloc_update (mg );
1666
- atomic_add_64 (& mg -> mg_alloc_failures , - failures );
1667
1656
1668
1657
/*
1669
1658
* Preload the next potential metaslabs
@@ -1690,7 +1679,7 @@ metaslab_distance(metaslab_t *msp, dva_t *dva)
1690
1679
1691
1680
static uint64_t
1692
1681
metaslab_group_alloc (metaslab_group_t * mg , uint64_t psize , uint64_t asize ,
1693
- uint64_t txg , uint64_t min_distance , dva_t * dva , int d , int flags )
1682
+ uint64_t txg , uint64_t min_distance , dva_t * dva , int d )
1694
1683
{
1695
1684
spa_t * spa = mg -> mg_vd -> vdev_spa ;
1696
1685
metaslab_t * msp = NULL ;
@@ -1717,10 +1706,9 @@ metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize,
1717
1706
spa_dbgmsg (spa , "%s: failed to meet weight "
1718
1707
"requirement: vdev %llu, txg %llu, mg %p, "
1719
1708
"msp %p, psize %llu, asize %llu, "
1720
- "failures %llu, weight %llu" ,
1721
- spa_name (spa ), mg -> mg_vd -> vdev_id , txg ,
1722
- mg , msp , psize , asize ,
1723
- mg -> mg_alloc_failures , msp -> ms_weight );
1709
+ "weight %llu" , spa_name (spa ),
1710
+ mg -> mg_vd -> vdev_id , txg ,
1711
+ mg , msp , psize , asize , msp -> ms_weight );
1724
1712
mutex_exit (& mg -> mg_lock );
1725
1713
return (-1ULL );
1726
1714
}
@@ -1752,27 +1740,6 @@ metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize,
1752
1740
1753
1741
mutex_enter (& msp -> ms_lock );
1754
1742
1755
- /*
1756
- * If we've already reached the allowable number of failed
1757
- * allocation attempts on this metaslab group then we
1758
- * consider skipping it. We skip it only if we're allowed
1759
- * to "fast" gang, the physical size is larger than
1760
- * a gang block, and we're attempting to allocate from
1761
- * the primary metaslab.
1762
- */
1763
- if (mg -> mg_alloc_failures > zfs_mg_alloc_failures &&
1764
- CAN_FASTGANG (flags ) && psize > SPA_GANGBLOCKSIZE &&
1765
- activation_weight == METASLAB_WEIGHT_PRIMARY ) {
1766
- spa_dbgmsg (spa , "%s: skipping metaslab group: "
1767
- "vdev %llu, txg %llu, mg %p, msp[%llu] %p, "
1768
- "psize %llu, asize %llu, failures %llu" ,
1769
- spa_name (spa ), mg -> mg_vd -> vdev_id , txg , mg ,
1770
- msp -> ms_id , msp , psize , asize ,
1771
- mg -> mg_alloc_failures );
1772
- mutex_exit (& msp -> ms_lock );
1773
- return (-1ULL );
1774
- }
1775
-
1776
1743
/*
1777
1744
* Ensure that the metaslab we have selected is still
1778
1745
* capable of handling our request. It's possible that
@@ -1812,8 +1779,6 @@ metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize,
1812
1779
if ((offset = metaslab_block_alloc (msp , asize )) != -1ULL )
1813
1780
break ;
1814
1781
1815
- atomic_inc_64 (& mg -> mg_alloc_failures );
1816
-
1817
1782
metaslab_passivate (msp , metaslab_block_maxsize (msp ));
1818
1783
mutex_exit (& msp -> ms_lock );
1819
1784
}
@@ -1980,7 +1945,7 @@ metaslab_alloc_dva(spa_t *spa, metaslab_class_t *mc, uint64_t psize,
1980
1945
ASSERT (P2PHASE (asize , 1ULL << vd -> vdev_ashift ) == 0 );
1981
1946
1982
1947
offset = metaslab_group_alloc (mg , psize , asize , txg , distance ,
1983
- dva , d , flags );
1948
+ dva , d );
1984
1949
if (offset != -1ULL ) {
1985
1950
/*
1986
1951
* If we've just selected this metaslab group,
0 commit comments