Bug #2543
bad duality in metaslab_df_alloc/metaslab_df_fragmented
0%
Description
in metaslab_df_alloc the rule to switch to first-fit is:
if (max_size < metaslab_df_alloc_threshold ||
free_pct < metaslab_df_free_pct) {
in metaslab_df_fragmented the rule to tag a spacemap not fragmented is:
if (max_size >= metaslab_df_alloc_threshold &&
free_pct >= metaslab_df_free_pct)
return (B_FALSE);
the conditions are equivalent and it's a problem:
- the block allocator always use the same metaslab in a txg context.
- metaslab can be tagged fragmented after
So, metaslab_df_alloc switch to best-fit to first-fit algorithm before metaslab_df_fragmented tag metaslab fragmented (and zfs decide to switch to fresh metaslab) : IO dramatically drop for the interval (with first-fit).
Metaslab should tagged fragmented before.
Change metaslab_df_fragmented condition like :
if (max_size > metaslab_df_alloc_threshold &&
free_pct > metaslab_df_free_pct)
return (B_FALSE);
should resolve this issue.
No data to display