ahrens commented on this pull request.
> + ASSERT(spa->spa_num_auto_trimming > 0); + spa->spa_num_auto_trimming--; + if (spa->spa_num_auto_trimming == 0) + cv_broadcast(&spa->spa_auto_trim_done_cv); + mutex_exit(&spa->spa_auto_trim_lock); +} + +/* + * Determines the minimum sensible rate at which a manual TRIM can be + * performed on a given spa and returns it. Since we perform TRIM in + * metaslab-sized increments, we'll just let the longest step between + * metaslab TRIMs be 100s (random number, really). Thus, on a typical + * 200-metaslab vdev, the longest TRIM should take is about 5.5 hours. + * It *can* take longer if the device is really slow respond to + * zio_trim() commands or it contains more than 200 metaslabs, or + * metaslab sizes vary widely between top-level vdevs. The code here deals with metaslabs, and I think is correctly described by the comment. I think you're trying to make it so that we don't attempt to sleep for more than 100 seconds (which seems reasonable even if unnecessary), and assuming that we do one sleep per metaslab. However, I think that the rate-limiting code doesn't care about metaslabs anymore. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/openzfs/openzfs/pull/172#discussion_r116150771 ------------------------------------------ openzfs-developer Archives: https://openzfs.topicbox-beta.com/groups/developer/ Powered by Topicbox: https://topicbox-beta.com
