20 Star 29 Fork 145

src-openEuler/qemu
关闭

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
migration-multifd-Forbid-spurious-wakeups.patch 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
张鹏瑞 提交于 2025-05-27 18:51 +08:00 . QEMU update to version 8.2.0-33:
From d4f46c41e0dd921563614ad48e7099eeac06d285 Mon Sep 17 00:00:00 2001
From: Peter Xu <peterx@redhat.com>
Date: Fri, 2 Feb 2024 18:28:48 +0800
Subject: [38/99] migration/multifd: Forbid spurious wakeups
commit 859ebaf346e8b5dece6cf255c604fe953d8ec9ab upstream.
Now multifd's logic is designed to have no spurious wakeup. I still
remember a talk to Juan and he seems to agree we should drop it now, and if
my memory was right it was there because multifd used to hit that when
still debugging.
Let's drop it and see what can explode; as long as it's not reaching
soft-freeze.
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240202102857.110210-15-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Jason Zeng <jason.zeng@intel.com>
---
migration/multifd.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/migration/multifd.c b/migration/multifd.c
index d4528cf9d1..3b7984cf99 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -760,7 +760,9 @@ static void *multifd_send_thread(void *opaque)
p->next_packet_size = 0;
qatomic_set(&p->pending_job, false);
qemu_mutex_unlock(&p->mutex);
- } else if (qatomic_read(&p->pending_sync)) {
+ } else {
+ /* If not a normal job, must be a sync request */
+ assert(qatomic_read(&p->pending_sync));
p->flags = MULTIFD_FLAG_SYNC;
multifd_send_fill_packet(p);
ret = qio_channel_write_all(p->c, (void *)p->packet,
@@ -775,9 +777,6 @@ static void *multifd_send_thread(void *opaque)
qatomic_set(&p->pending_sync, false);
qemu_mutex_unlock(&p->mutex);
qemu_sem_post(&p->sem_sync);
- } else {
- qemu_mutex_unlock(&p->mutex);
- /* sometimes there are spurious wakeups */
}
}
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/qemu.git
git@gitee.com:src-openeuler/qemu.git
src-openeuler
qemu
qemu
master

搜索帮助