On Tue, Apr 16, 2024 at 04:43:02PM +0200, Maciej S. Szmigiero wrote: > +bool multifd_queue_page(RAMBlock *block, ram_addr_t offset) > +{ > + g_autoptr(GMutexLocker) locker = NULL; > + > + /* > + * Device state submissions for shared channels can come > + * from multiple threads and conflict with page submissions > + * with respect to multifd_send_state access. > + */ > + if (!multifd_send_state->device_state_dedicated_channels) { > + locker = g_mutex_locker_new(&multifd_send_state->queue_job_mutex);
Haven't read the rest, but suggest to stick with QemuMutex for the whole patchset, as that's what we use in the rest migration code, along with QEMU_LOCK_GUARD(). > + } > + > + return multifd_queue_page_locked(block, offset); > +} -- Peter Xu