Repository navigation
多开:绑核按各组 L3 的负载分组,忙等按宿主余量开 - #34
Merged
Merged
Conversation
qiyinxi
added a commit
to qiyinxi/ModAVDManager
that referenced
this pull request
Nov 3, 2026
把 upstream/main 的 5a87a88 合进来,里面是 ModAVD#29 a2fc68d、ModAVD#30 ab77869、ModAVD#34 f4b9aa0、ModAVD#31 5a87a88。 这个分支原来建在 ModAVD#29 的旧提交 82e1e61 上;ModAVD#29 squash 进 main 时比它多了 relaunchAfterAdoptedGone 和 stopSeen。 冲突 8 个文件,解法: - internal/emu/start.go(5 块):两边都留。 - 接管循环开头:留 ModAVD#29 的 adoptedAt、stopSeen;找 qemu 用本分支的 startFindQemu。 - windowConflict 那段检查照旧放在 waitShutdown 之后、接管之前;接管时记下 adoptedAt。 - waitBoot 带上 &stopSeen;第二轮开机由 relaunchAfterAdoptedGone 判断。 - relaunchAfterAdoptedGone 函数照 main。 - internal/emu/start_test.go(2 块):留本分支的 TestStartNoSwitchWhileRunning;TestWaitBootAdoptedGone 和 TestRelaunchAfterAdoptedGone 照 main(带 stopSeen)。 - internal/cli/cli.go、commands.go(各 1 块):status 的契约注释和 statusOf 两边的字段都留(window、 creation_progress)。 - internal/cli/run_test.go(2 块):TestStatusSubset 的两条期望两边的字段都带上。另外 main 新加的「新建中」那条期望 是自动合进来的,没有 window,补上 "window":false(新建时后台那次开机是无头)。 - internal/ui/web/js/cards.js(1 块):留 main 的「新建中 NN%」,去掉本分支已经删掉的「重启中」。 - README.md、README.en.md(各 2 块):start 那一行用本分支的(--window | --headless,运行中不换);执行桥那一条用 main 的(ModAVD#30 的更新说明),只把「start / restart 的 --no-bridge」改成「start 的 --no-bridge」。 合完以后和 main 的差别就是本分支自己的改动,外加上面那处 "window":false。
This was referenced Nov 3, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
多开时,绑核改成按各组 L3 的负载分组;下载时的忙等循环改成按宿主的余量开。Fixes ModAVD/ModAVD#34
改了什么
绑核(
internal/emu/afterboot.go的tuneHostScheduling)SetAffinity只用在本实例的 qemu 上。config.ini;别的进程看命令行里的-cores;都没有就按本实例的核数估。%LOCALAPPDATA%\ModAVD\affinity.lock(LockFileEx)里做完,几台同时开机也不会挑到同一组。同一用户的进程不管是不是管理员权限,用的都是这把锁;不同用户之间不互斥。win.GetAffinity、win.L3Groups。win.BigL3CPUs不再有人用,删掉。忙等(
internal/guest/scripts/mas-idlepoll.sh和setupIdlepoll)daemon [N]给每次突发的忙等循环数设上限。不带 N 时和以前一样,每个 vCPU 一个;N 为 0 时只监视、不忙等。status多一行max:。host.py、res/avd/guest/mas-idlepoll.sh)没有改:AUTO-MAS 以后改成调用 modavd。实测
机器和条件
每台的下载速度(MB/s):先写所有有效轮次里所有实例的中位数,括号里是范围,后面是 CPU 两组(0–15 / 16–31)占用的中位数。
忙等循环数(1 台,生产负载为无,每种 3 轮交替,每台 MB/s)
issue 里的验收
明日方舟真实下载:只测到 1 轮,没能确认。
验证
-cores。GetAffinity在真进程上读回SetAffinity设的值,进程退出后报错。go test ./...通过;windows、linux、darwin/arm64 三个目标的go vet通过。留到后面的
Buffers full后断开,其中 3 台退出。QEMU2 main loop,然后崩溃(0xC0000005),直到结束那个 netsimd 才恢复。