Copy link
@adilger

adilger May 20, 2016

This should probably default to be at least:

DNODES_PER_BLOCK << (DMU_META_DNODE(os)->dn_indblkshift - SPA_BLKPTRSHIFT)

but more likely 4-8x that amount. The reason is that there is no point going back to rescan blocks if there aren't at least 3/4 of one block of free dnodes, otherwise the fill count heuristic will just skip the partially free blocks anyway. Also, if the freed dnodes are not all in a single block, the fill count heuristic will also skip the partially-empty blocks, so we may as well not rescan until there are a likely to be full free blocks to fill, since this always scans from the start of the metadnode (which may be referencing billions of objects on a large Lustre filesystem) so it makes sense to avoid this rescanning as much as possible.