Optimize metaslab_set_selected_txg()

I don't think it makes much sense to choose for eviction between
metaslabs selected in the same TXG.  Considering that we also don't
evict them for at least 32 TXG, the difference should be in a noise.
Just skip the metaslab bumping if we already done it in this TXG.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Rob Norris <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Closes #18669
This commit is contained in:
Alexander Motin authored and GitHub committed 2026-06-24 12:24:54 -07:00
1 parent 2ea519c2a5
commit 99ab859c38
1 file changed
+3
+3
View File
@@ -2854,6 +2854,9 @@ metaslab_set_selected_txg(metaslab_t *msp, uint64_t txg)
{
ASSERT(MUTEX_HELD(&msp->ms_lock));
metaslab_class_t *mc = msp->ms_group->mg_class;
if (msp->ms_selected_txg == txg &&
multilist_link_active(&msp->ms_class_txg_node))
return;
multilist_sublist_t *mls =
multilist_sublist_lock_obj(&mc->mc_metaslab_txg_list, msp);
if (multilist_link_active(&msp->ms_class_txg_node))