skiselkov commented on this pull request.
> +
+/*
+ * Notifies the trimsets in a metaslab that an extent has been freed.
+ * This adds the segment to the currently open queue of extents awaiting
+ * to be trimmed.
+ */
+static void
+metaslab_trim_add(void *arg, uint64_t offset, uint64_t size)
+{
+ metaslab_t *msp = arg;
+
+ ASSERT(MUTEX_HELD(&msp->ms_lock));
+ ASSERT(msp->ms_cur_ts != NULL);
+ range_tree_add(msp->ms_cur_ts, offset, size);
+ ASSERT(msp->ms_prev_ts == NULL ||
+ !range_tree_contains_part(msp->ms_prev_ts, offset, size));
Actually, I remembered why we can't. `metaslab_trim_add` can be called
asynchronously from the manual trim path, however an autotrim can at the same
time still be ongoing. I'll 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_r114457006
------------------------------------------
openzfs-developer
Archives: https://openzfs.topicbox-beta.com/groups/developer/
Powered by Topicbox: https://topicbox-beta.com