skiselkov commented on this pull request.


> +     limited = mused > mlim;
+       DTRACE_PROBE3(autotrim__mem__lim, vdev_t *, vd, uint64_t, mused,
+           uint64_t, mlim);
+
+       /*
+        * Since we typically have hundreds of metaslabs per vdev, but we only
+        * trim them once every zfs_txgs_per_trim txgs, it'd be best if we
+        * could sequence the TRIM commands from all metaslabs so that they
+        * don't all always pound the device in the same txg. We do so taking
+        * the txg number modulo txgs_per_trim and then skipping by
+        * txgs_per_trim. Thus, for the default 200 metaslabs and 32
+        * txgs_per_trim, we'll only be trimming ~6.25 metaslabs per txg.
+        */
+       for (uint64_t i = txg % txgs_per_trim; i < vd->vdev_ms_count;
+           i += txgs_per_trim)
+               metaslab_auto_trim(vd->vdev_ms[i], !limited);

I'll flip the boolean and rename it to `preserve_spilled` in `vdev_auto_trim` 
as well to make it obvious. I'll also add a comment about it.

-- 
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_r114528725
------------------------------------------
openzfs-developer
Archives: https://openzfs.topicbox.com/groups/developer/
Powered by Topicbox: https://topicbox.com

Reply via email to