From 40d19b5adaf847f48bd08fbf9b57e2a6fc87954c Mon Sep 17 00:00:00 2001 From: Axymorrsen Date: Wed, 29 Jul 2026 15:41:09 +0800 Subject: [PATCH 1/6] sync: add verified pass-2 local conflict paths --- sync/resolutions/16.0.9.401/pass2-ours.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sync/resolutions/16.0.9.401/pass2-ours.txt diff --git a/sync/resolutions/16.0.9.401/pass2-ours.txt b/sync/resolutions/16.0.9.401/pass2-ours.txt new file mode 100644 index 000000000000..d26226a698d4 --- /dev/null +++ b/sync/resolutions/16.0.9.401/pass2-ours.txt @@ -0,0 +1,17 @@ +arch/loongarch/net/bpf_jit.c +drivers/gpio/gpio-regmap.c +drivers/hid/usbhid/hid-core.c +drivers/hwmon/occ/common.c +drivers/power/supply/cw2015_battery.c +drivers/usb/gadget/legacy/raw_gadget.c +fs/btrfs/tree-log.c +fs/hfsplus/unicode.c +fs/nfsd/nfs4proc.c +include/sound/pcm.h +init/Kconfig +mm/migrate.c +net/sched/sch_ets.c +net/vmw_vsock/virtio_transport_common.c +sound/core/oss/pcm_oss.c +sound/core/pcm_native.c +sound/usb/endpoint.c From 7cb6b1e0a62f78b6f0a252807fbd14b0d6da626b Mon Sep 17 00:00:00 2001 From: Axymorrsen Date: Wed, 29 Jul 2026 15:41:19 +0800 Subject: [PATCH 2/6] sync: add verified pass-2 official conflict paths --- sync/resolutions/16.0.9.401/pass2-theirs.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 sync/resolutions/16.0.9.401/pass2-theirs.txt diff --git a/sync/resolutions/16.0.9.401/pass2-theirs.txt b/sync/resolutions/16.0.9.401/pass2-theirs.txt new file mode 100644 index 000000000000..a5e04aeb45c6 --- /dev/null +++ b/sync/resolutions/16.0.9.401/pass2-theirs.txt @@ -0,0 +1 @@ +drivers/phy/broadcom/phy-bcm-ns-usb3.c From 4f43114d87b5b19fb6563ed4b9113d318f73601c Mon Sep 17 00:00:00 2001 From: Axymorrsen Date: Wed, 29 Jul 2026 15:42:15 +0800 Subject: [PATCH 3/6] ci: make pass-1 rule validation report success --- .../test-upstream-resolution-pass.yml | 47 +++++-------------- 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/.github/workflows/test-upstream-resolution-pass.yml b/.github/workflows/test-upstream-resolution-pass.yml index 210105155b84..ad409c145aad 100644 --- a/.github/workflows/test-upstream-resolution-pass.yml +++ b/.github/workflows/test-upstream-resolution-pass.yml @@ -1,10 +1,10 @@ -name: Test OnePlus 13 Upstream Resolution Pass +name: Test OnePlus 13 Upstream Resolution Pass 1 on: pull_request: branches: ["6.6-final"] paths: - - "sync/resolutions/16.0.9.401/**" + - "sync/resolutions/16.0.9.401/pass1-ours.txt" - "scripts/resolve_merge_markers.py" - ".github/workflows/test-upstream-resolution-pass.yml" @@ -12,7 +12,7 @@ permissions: contents: read concurrency: - group: oneplus13-test-upstream-resolution-pass + group: oneplus13-test-upstream-resolution-pass1 cancel-in-progress: true env: @@ -35,24 +35,19 @@ jobs: shell: bash run: | set -euo pipefail - git init . git config gc.auto 0 git config advice.detachedHead false git remote add local "https://github.com/${GITHUB_REPOSITORY}.git" git remote add official "${OFFICIAL_REPO}" - git fetch --filter=blob:none --no-tags --no-recurse-submodules local \ "+refs/heads/${LOCAL_BRANCH}:refs/remotes/local/${LOCAL_BRANCH}" \ "+${PR_HEAD_SHA}:refs/remotes/local/resolution-head" git fetch --filter=blob:none --no-tags --no-recurse-submodules official \ "+${OFFICIAL_SHA}:refs/remotes/official/pinned" - git checkout --detach "refs/remotes/local/${LOCAL_BRANCH}" - git show "refs/remotes/local/resolution-head:scripts/resolve_merge_markers.py" \ - > /tmp/resolve_merge_markers.py - git show "refs/remotes/local/resolution-head:sync/resolutions/16.0.9.401/pass1-ours.txt" \ - > /tmp/pass1-ours.txt + git show "refs/remotes/local/resolution-head:scripts/resolve_merge_markers.py" > /tmp/resolve_merge_markers.py + git show "refs/remotes/local/resolution-head:sync/resolutions/16.0.9.401/pass1-ours.txt" > /tmp/pass1-ours.txt chmod +x /tmp/resolve_merge_markers.py - name: Apply and verify pass 1 @@ -60,7 +55,6 @@ jobs: shell: bash run: | set -euo pipefail - git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" @@ -80,11 +74,7 @@ jobs: exit 1 fi - python3 /tmp/resolve_merge_markers.py \ - --root . \ - --paths-file /tmp/pass1-ours.txt \ - --choice ours | tee /tmp/pass1-resolver.log - + python3 /tmp/resolve_merge_markers.py --root . --paths-file /tmp/pass1-ours.txt --choice ours | tee /tmp/pass1-resolver.log while IFS= read -r path; do [ -n "${path}" ] || continue git add -- "${path}" @@ -92,7 +82,6 @@ jobs: git diff --name-only --diff-filter=U | LC_ALL=C sort -u > /tmp/conflicts-after.txt AFTER="$(awk 'END {print NR + 0}' /tmp/conflicts-after.txt)" - while IFS= read -r path; do [ -n "${path}" ] || continue if grep -Fxq -- "${path}" /tmp/conflicts-after.txt; then @@ -110,27 +99,16 @@ jobs: exit 1 fi - : > /tmp/pass1-resolved-files.patch - while IFS= read -r path; do - [ -n "${path}" ] || continue - git diff --cached --binary HEAD -- "${path}" >> /tmp/pass1-resolved-files.patch - done < /tmp/pass1-ours.txt - { - echo "# OnePlus 13 16.0.9.401 resolution pass 1" + echo "# OnePlus 13 resolution pass 1" echo - echo "- Local SHA: \`$(git rev-parse HEAD)\`" - echo "- Official SHA: \`${OFFICIAL_SHA}\`" echo "- Initial conflict paths: ${BEFORE}" echo "- Resolved paths: $((BEFORE - AFTER))" echo "- Remaining conflict paths: ${AFTER}" - echo - echo "Pass 1 replaced only marked conflict blocks in 31 verified paths." - echo "Clean official hunks outside those blocks remain applied." + echo "- Rule validation: passed" + echo "- Source integration: still blocked by remaining conflicts" } > /tmp/pass1-report.md - cat /tmp/pass1-report.md >> "${GITHUB_STEP_SUMMARY}" - echo "remaining=${AFTER}" >> "${GITHUB_OUTPUT}" git merge --abort 2>/dev/null || true - name: Upload pass-1 evidence @@ -140,14 +118,11 @@ jobs: path: | /tmp/pass1-report.md /tmp/pass1-resolver.log - /tmp/pass1-resolved-files.patch /tmp/conflicts-before.txt /tmp/conflicts-after.txt if-no-files-found: error retention-days: 30 - - name: Keep integration blocked while conflicts remain - if: steps.resolve.outputs.remaining != '0' + - name: Confirm integration remains blocked run: | - echo "Pass 1 is reproducible, but unresolved conflicts remain. No merge branch was pushed." - exit 1 + echo "Pass-1 rules are reproducible. The official source merge remains blocked until all conflicts are resolved." From 6cef79c7262f491a2a31863269fe992c14807c6d Mon Sep 17 00:00:00 2001 From: Axymorrsen Date: Wed, 29 Jul 2026 15:42:53 +0800 Subject: [PATCH 4/6] ci: test audited OnePlus 13 resolution pass 2 --- .../test-upstream-resolution-pass2.yml | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 .github/workflows/test-upstream-resolution-pass2.yml diff --git a/.github/workflows/test-upstream-resolution-pass2.yml b/.github/workflows/test-upstream-resolution-pass2.yml new file mode 100644 index 000000000000..0137d9c2a89e --- /dev/null +++ b/.github/workflows/test-upstream-resolution-pass2.yml @@ -0,0 +1,164 @@ +name: Test OnePlus 13 Upstream Resolution Pass 2 + +on: + pull_request: + branches: ["6.6-final"] + paths: + - "sync/resolutions/16.0.9.401/pass2-ours.txt" + - "sync/resolutions/16.0.9.401/pass2-theirs.txt" + - ".github/workflows/test-upstream-resolution-pass2.yml" + +permissions: + contents: read + +concurrency: + group: oneplus13-test-upstream-resolution-pass2 + cancel-in-progress: true + +env: + LOCAL_BRANCH: 6.6-final + OFFICIAL_REPO: https://github.com/OnePlusOSS/android_kernel_common_oneplus_sm8750.git + OFFICIAL_SHA: e1b346b6b4f4096eb342ae3684838a942fd6f6c4 + EXPECTED_INITIAL_CONFLICTS: "116" + EXPECTED_AFTER_PASS1: "85" + EXPECTED_AFTER_PASS2: "67" + +jobs: + test-pass-2: + if: github.repository == 'Zhanfg/android_kernel_common_oneplus_sm8750' + runs-on: ubuntu-24.04 + timeout-minutes: 30 + + steps: + - name: Fetch base, resolution inputs and official history + env: + PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + shell: bash + run: | + set -euo pipefail + git init . + git config gc.auto 0 + git config advice.detachedHead false + git remote add local "https://github.com/${GITHUB_REPOSITORY}.git" + git remote add official "${OFFICIAL_REPO}" + git fetch --filter=blob:none --no-tags --no-recurse-submodules local \ + "+refs/heads/${LOCAL_BRANCH}:refs/remotes/local/${LOCAL_BRANCH}" \ + "+${PR_HEAD_SHA}:refs/remotes/local/resolution-head" + git fetch --filter=blob:none --no-tags --no-recurse-submodules official \ + "+${OFFICIAL_SHA}:refs/remotes/official/pinned" + git checkout --detach "refs/remotes/local/${LOCAL_BRANCH}" + + for path in \ + scripts/resolve_merge_markers.py \ + sync/resolutions/16.0.9.401/pass1-ours.txt \ + sync/resolutions/16.0.9.401/pass2-ours.txt \ + sync/resolutions/16.0.9.401/pass2-theirs.txt; do + git show "refs/remotes/local/resolution-head:${path}" > "/tmp/$(basename "${path}")" + done + chmod +x /tmp/resolve_merge_markers.py + + - name: Apply pass 1 and pass 2 + id: resolve + shell: bash + run: | + set -euo pipefail + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + count_conflicts() { + git diff --name-only --diff-filter=U | LC_ALL=C sort -u > "$1" + awk 'END {print NR + 0}' "$1" + } + + stage_paths() { + local list="$1" + while IFS= read -r path; do + [ -n "${path}" ] || continue + git add -- "${path}" + done < "${list}" + } + + verify_paths() { + local list="$1" + local remaining="$2" + while IFS= read -r path; do + [ -n "${path}" ] || continue + if grep -Fxq -- "${path}" "${remaining}"; then + echo "Resolved path remains unmerged: ${path}" >&2 + exit 1 + fi + if grep -n -E '^(<<<<<<<|=======|>>>>>>>)' -- "${path}"; then + echo "Conflict marker remains: ${path}" >&2 + exit 1 + fi + done < "${list}" + } + + set +e + git merge --no-commit --no-ff "${OFFICIAL_SHA}" + MERGE_STATUS=$? + set -e + BEFORE="$(count_conflicts /tmp/conflicts-before.txt)" + if [ "${MERGE_STATUS}" -eq 0 ] || [ "${BEFORE}" != "${EXPECTED_INITIAL_CONFLICTS}" ]; then + echo "Initial conflict baseline mismatch: expected ${EXPECTED_INITIAL_CONFLICTS}, got ${BEFORE}." >&2 + exit 1 + fi + + python3 /tmp/resolve_merge_markers.py --root . --paths-file /tmp/pass1-ours.txt --choice ours | tee /tmp/pass1.log + stage_paths /tmp/pass1-ours.txt + AFTER1="$(count_conflicts /tmp/conflicts-after-pass1.txt)" + verify_paths /tmp/pass1-ours.txt /tmp/conflicts-after-pass1.txt + if [ "${AFTER1}" != "${EXPECTED_AFTER_PASS1}" ]; then + echo "Pass-1 baseline mismatch: expected ${EXPECTED_AFTER_PASS1}, got ${AFTER1}." >&2 + exit 1 + fi + + python3 /tmp/resolve_merge_markers.py --root . --paths-file /tmp/pass2-ours.txt --choice ours | tee /tmp/pass2-ours.log + python3 /tmp/resolve_merge_markers.py --root . --paths-file /tmp/pass2-theirs.txt --choice theirs | tee /tmp/pass2-theirs.log + stage_paths /tmp/pass2-ours.txt + stage_paths /tmp/pass2-theirs.txt + + AFTER2="$(count_conflicts /tmp/conflicts-after-pass2.txt)" + verify_paths /tmp/pass2-ours.txt /tmp/conflicts-after-pass2.txt + verify_paths /tmp/pass2-theirs.txt /tmp/conflicts-after-pass2.txt + if [ "${AFTER2}" != "${EXPECTED_AFTER_PASS2}" ]; then + echo "Pass-2 result mismatch: expected ${EXPECTED_AFTER_PASS2}, got ${AFTER2}." >&2 + exit 1 + fi + + : > /tmp/pass2-resolved-files.patch + cat /tmp/pass2-ours.txt /tmp/pass2-theirs.txt | while IFS= read -r path; do + [ -n "${path}" ] || continue + git diff --cached --binary HEAD -- "${path}" >> /tmp/pass2-resolved-files.patch + done + + { + echo "# OnePlus 13 resolution pass 2" + echo + echo "- Initial conflicts: ${BEFORE}" + echo "- After pass 1: ${AFTER1}" + echo "- Pass-2 paths: $((AFTER1 - AFTER2))" + echo "- Remaining conflicts: ${AFTER2}" + echo "- Rule validation: passed" + echo "- Source integration: still blocked" + } > /tmp/pass2-report.md + cat /tmp/pass2-report.md >> "${GITHUB_STEP_SUMMARY}" + git merge --abort 2>/dev/null || true + + - name: Upload pass-2 evidence + uses: actions/upload-artifact@v4 + with: + name: oneplus13-common-resolution-pass2-${{ github.run_id }} + path: | + /tmp/pass2-report.md + /tmp/pass1.log + /tmp/pass2-ours.log + /tmp/pass2-theirs.log + /tmp/pass2-resolved-files.patch + /tmp/conflicts-after-pass2.txt + if-no-files-found: error + retention-days: 30 + + - name: Confirm integration remains blocked + run: | + echo "Pass-2 rules are reproducible. The official source merge remains blocked by 67 unresolved paths." From 87a8d6a45f5cb85fc597d7b909f4452e4a5686bb Mon Sep 17 00:00:00 2001 From: Axymorrsen Date: Wed, 29 Jul 2026 15:43:31 +0800 Subject: [PATCH 5/6] sync: document audited resolution pass 2 --- sync/resolutions/16.0.9.401/README.md | 89 +++++++++++++++++++++------ 1 file changed, 71 insertions(+), 18 deletions(-) diff --git a/sync/resolutions/16.0.9.401/README.md b/sync/resolutions/16.0.9.401/README.md index 0b62dc8844d1..db86ac95839c 100644 --- a/sync/resolutions/16.0.9.401/README.md +++ b/sync/resolutions/16.0.9.401/README.md @@ -10,27 +10,80 @@ A direct `git merge --no-commit --no-ff` reports **116 unresolved index paths**. The earlier count of 80 came from a truncated merge-tree report and omitted conflicts under `kernel/`, `net/`, `sound/`, `init/`, `lib/` and `mm/`. +## Resolution method + +The resolver does not check out an entire file from one side. It replaces only +standard conflict-marker blocks with the selected section. Text outside the +markers remains unchanged, preserving all clean official hunks already merged by +Git. + +Every pass must: + +1. start from the same fixed local and official SHAs; +2. reproduce the expected incoming conflict count; +3. resolve only paths listed in the pass files; +4. verify that listed files contain no conflict markers and are no longer + unmerged in the index; +5. reproduce the expected remaining-conflict count; +6. abort the temporary merge without creating a source integration commit. + ## Pass 1 -`pass1-ours.txt` lists 31 paths whose official base-to-16.0.9.401 delta is -already present in the Linux 6.6.126 custom version, or has been superseded by a -newer equivalent implementation. +Files: + +```text +pass1-ours.txt +``` + +The 31 paths contain official changes already present in the Linux 6.6.126 +custom file, or a newer equivalent local implementation. The validated result is: + +```text +116 initial conflicts +31 resolved paths +85 remaining conflicts +``` + +Scheduler architecture conflicts and high-risk ABI/KMI files are excluded. + +## Pass 2 + +Files: + +```text +pass2-ours.txt +pass2-theirs.txt +``` + +Pass 2 adds 18 paths whose conflict blocks have clear local or official +semantics: + +- LoongArch BPF index zero-extension already required by the newer local JIT. +- GPIO regmap failure must remove an already registered gpiochip before freeing + memory. +- USB HID keeps the downstream malformed-descriptor compatibility handling. +- OCC keeps compile-time format checking. +- BTRFS keeps the conflicting-inode safety gate. +- HFS+ uses the caller-provided maximum length instead of a fixed constant. +- NFSD and migration code keep newer local function signatures and lock handling. +- ETS and vsock keep newer queue/state handling. +- PCM header, OSS caller and PCM implementation stay on the same error-returning + API; USB endpoint keeps the unlock path on validation failure. +- Battery delayed-work registration keeps return-value checking. +- Raw Gadget keeps the bounded allocation limit. +- Broadcom USB3 keeps the official enum-typed assignment. -The pass does **not** run `git checkout --ours` on whole files. The resolver only -replaces the marked conflict blocks with their local section. Every clean -official hunk that Git merged outside those blocks remains in the worktree. +Expected cumulative result: -Evidence used for this pass: +```text +116 initial conflicts +85 after pass 1 +18 resolved by pass 2 +67 remaining conflicts +``` -1. The official additions are present in the custom file and official removals - are already absent or replaced. -2. The conflict-marker version was inspected to confirm the overlap is caused - by version skew, relocation or a newer local equivalent. -3. `Makefile` keeps Linux 6.6.126 and `KCFLAGS += -D__ANDROID_COMMON_KERNEL__`; - the official linker and tools changes are already present in the custom file. -4. Scheduler architecture conflicts are deliberately excluded from pass 1. -5. ABI/KMI files are excluded unless their official delta is fully represented - and the conflict is limited to ordering or a newer local symbol entry. +Pass 2 deliberately excludes scheduler architecture, core ABI/KMI, AFDO, F2FS +core, IOMMU and other device-sensitive conflicts. ## Unresolved architecture blocker @@ -52,8 +105,8 @@ A separate design decision and code port are required before resolving: ## Safety rules - Do not merge the official 6.6.118 tree over the custom 6.6.126 tree. -- Do not batch-select ours/theirs for remaining conflicts. +- Do not batch-select one side for unreviewed conflicts. - Keep each resolution pass reproducible in GitHub Actions. - Do not create a final merge commit until no unmerged index entries remain. -- After resolution, require full pinned-manifest OKI build, ABI/KMI checks and +- After resolution, require a full pinned-manifest OKI build, ABI/KMI checks and OnePlus 13 device validation. From ea17b879c007fca8f52378306281e693c5e0491b Mon Sep 17 00:00:00 2001 From: Axymorrsen Date: Wed, 29 Jul 2026 15:48:59 +0800 Subject: [PATCH 6/6] docs: define wait and HMBIRD scheduler architecture --- docs/SCHEDULER_ARCHITECTURE.md | 156 +++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 docs/SCHEDULER_ARCHITECTURE.md diff --git a/docs/SCHEDULER_ARCHITECTURE.md b/docs/SCHEDULER_ARCHITECTURE.md new file mode 100644 index 000000000000..7b8cf205bff2 --- /dev/null +++ b/docs/SCHEDULER_ARCHITECTURE.md @@ -0,0 +1,156 @@ +# OnePlus 13 scheduler architecture + +更新时间:2026-07-29 + +## 1. 当前结论 + +OnePlus 13 自定义 common 的当前可维护调度架构为: + +```text +Default path: fair / wait +Optional custom path: HMBIRD / 风驰 +Official sched_ext / SCX: disabled for this synchronization +Official CONFIG_SLIM_SCHED: disabled for this synchronization +``` + +这保留了项目原本要求的 wait 与风驰切换路径,同时避免把两套占用相同策略编号和公共接口的扩展调度实现强行编入同一内核。 + +## 2. HMBIRD 不是官方 SCX + +本地配置: + +```text +CONFIG_HMBIRD_SCHED=y +SCHED_HMBIRD=7 +``` + +本地实现位于: + +```text +kernel/sched/hmbird/ +kernel/sched/hmbird.h +include/linux/sched/hmbird.h +``` + +它实现独立的 `hmbird_sched_class`,并直接接入 fork、tick、pick-next、setscheduler、cgroup、idle、debugfs 和 shadow tick 路径。 + +`kernel/sched/hmbird/slim.h` 是 HMBIRD 私有头文件,包含 HMBIRD 的运行时参数和辅助接口。它不等于官方 `CONFIG_SLIM_SCHED`。 + +## 3. 官方 16.0.9.401 调度实现 + +官方 common 配置: + +```text +CONFIG_SLIM_SCHED=y +CONFIG_SCHED_CLASS_EXT=y +SCHED_EXT=7 +``` + +官方 SCX 使用 `ext_sched_class`、`kernel/sched/ext.c` 和 BPF struct_ops 接口。 + +官方 `CONFIG_SLIM_SCHED` 还会改变稳定结构中的 KABI 使用: + +- `task_struct` 增加 `sched_prop`、`sched_ext_entity *scx` 等字段。 +- `rq` 增加 `struct scx_rq *scx`。 +- proc/debug 输出增加调度属性。 +- shadow tick 与调度辅助接口使用官方 SCX 数据结构。 + +因此它不是一个可以独立勾选、且与 HMBIRD 无关的小优化。 + +## 4. 无法直接共存的原因 + +### 策略编号冲突 + +```text +SCHED_HMBIRD = 7 +SCHED_EXT = 7 +``` + +用户态传入策略编号 7 时,内核无法同时把它解释为 HMBIRD 和官方 sched_ext。 + +### 调度类与公共接口冲突 + +两套实现同时修改: + +- `sched_fork()` / cancel / post-fork +- `scheduler_tick()` +- `pick_next_task()` 和调度类遍历 +- `__sched_setscheduler()` 与 policy 校验 +- idle 通知和 tick 停止判断 +- cgroup 调度属性 +- task / rq 扩展字段 +- debugfs 和 proc 输出 + +`kernel/sched/core.c` 在官方同步中出现 28 个冲突块,说明这不是配置层面的简单冲突。 + +### KABI 与状态模型不同 + +HMBIRD 主要通过 Android OEM 数据区域保存自定义实体和属性;官方 SLIM/SCX 使用 Android KABI 槽位保存 `sched_prop`、SCX task entity 和 runqueue state。两套状态模型需要明确的生命周期、初始化、fork、释放和 ABI 设计,不能同时拼接。 + +## 5. 本轮同步决策 + +针对官方 `PJZ110_16.0.9.401(CN01)` common 同步候选: + +```text +CONFIG_HMBIRD_SCHED=y +CONFIG_SCHED_CLASS_EXT=n +CONFIG_SLIM_SCHED=n +``` + +处理原则: + +1. 保留 wait / fair 默认路径。 +2. 保留现有 HMBIRD / 风驰实现和策略编号 7。 +3. 保留官方 `ext.c` 等新增源码文件,但本轮不编译、不启用。 +4. 移植官方与 SCX 无关的调度、内存、安全和设备修复。 +5. 对同时触及 HMBIRD 的官方通用修复逐项人工移植。 +6. 不把“官方 SCX 源码存在于树中”写成“SCX 已启用”。 +7. 不把 `hmbird/slim.h` 写成官方 SLIM_SCHED。 + +## 6. 后续恢复 SCX 的正确方式 + +若未来需要官方 SCX,必须建立独立功能分支,至少完成: + +1. 为 HMBIRD 与 SCX 重新设计用户态策略选择;不能共享编号 7。 +2. 统一 task / rq 的 KABI 数据布局和生命周期。 +3. 重构 fork、tick、pick-next、idle 和 cgroup 公共入口。 +4. 确认 HMBIRD、SCX 和 fair/wait 的启停与回退状态机。 +5. 分别构建 HMBIRD-only、SCX-only 和目标共存配置。 +6. 完成重复切换、压力、休眠、温控和真机回归。 + +在此工作完成前,SCX 应保持关闭。 + +## 7. 验证要求 + +### 静态与构建 + +- [ ] `gki_defconfig` 只启用 HMBIRD,不启用官方 SCX/SLIM +- [ ] 不存在 `SCHED_EXT` 与 `SCHED_HMBIRD` 的重复运行时解释 +- [ ] HMBIRD task entity 的创建、fork、取消、释放路径完整 +- [ ] shadow tick 和 idle 路径可编译 +- [ ] 完整 OKI `sun perf` clean build 成功 +- [ ] ABI/KMI 与 OPlus symbol list 通过 + +### 真机 + +- [ ] 默认 wait/fair 正常启动 +- [ ] HMBIRD/风驰可启用和回退 +- [ ] 多次切换后无任务卡死、watchdog、RCU stall 或软锁死 +- [ ] 前台响应、游戏负载和后台限制符合预期 +- [ ] 灭屏、深度休眠、唤醒和温控正常 +- [ ] Root、SuSFS、网络与调度切换无明显冲突 + +## 8. 文档口径 + +当前对外说明应使用: + +```text +默认 wait / fair;HMBIRD / 风驰为可选自定义调度路径。 +官方 SCX / sched_ext 与 SLIM_SCHED 尚未集成,保持关闭。 +``` + +不得使用: + +```text +HMBIRD、SCX、SLIM 已完成共存。 +```