On 19/06/2021 20:31, Vladimir Sementsov-Ogievskiy wrote:
19.06.2021 18:23, Vladimir Sementsov-Ogievskiy wrote:
  typedef struct BlockCopyTask {
      AioTask task;
+    /*
+     * IN parameters. Initialized in block_copy_task_create()
+     * and never changed.
+     */

That's just not true for method field :(

I think, we just need to document that @method is never accessed concurrently

Ok I got confused in the last patch. Method is read by block_copy_task_entry only after it is re-set in block_copy_dirty_clusters loop. Sorry for that.

Will leave it as IN and document it better.

Still, moving the lock granularity inside the while loop might not be too bad. Not sure though. At this point skip_unallocated can also be an atomic, even though I sense that you won't like that :)

Emanuele


Reply via email to