Skip to content

perf(console): reduce kernel logging and make COM1 output asynchronous - #39

Merged
Leonmmcoset merged 2 commits into
mainfrom
codex/async-kernel-logging
Nov 23, 2026
Merged

Leonmmcoset merged 2 commits into
mainfrom
codex/async-kernel-logging

Conversation

@VasilyZa

@VasilyZa VasilyZa commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

问题与效果

常规进程操作会产生日志,同步等待 UART 发送会拖慢命令启动和并发任务。默认关闭高频 DEBUG 日志,进入用户态后由串口中断批量发送常规输出。

流程与实现

  • 内核日志采用 [启动后秒数] [等级] [组件] 消息 格式。debug 或 loglevel=8 可开启进程和设备诊断,log=none 可关闭常规日志。
  • COM1 使用 115200 8N1 和 32 KiB 发送队列。IRQ4 批量填充 UART FIFO,定时器负责兜底。/dev/ttyS0 保留阻塞写和非阻塞背压,关机尝试排空,panic 保留直接输出。
  • 同步更新中、英、日三版启动文档,并补充串口顺序、队列背压、中断与定时器排空及紧急输出回归测试。

验证

  • 同步驱动管理器与 PS/2 IRQ 测试夹具后,本地 make test-ownership test-host-smoke test-tools 通过,宿主机回归 17 组通过。
  • 已编译默认内核和 CONFIG_SERIAL_8250=m 配置下的 serial.ko。中、英、日三版文档构建通过。
  • python3 tools/test_console.py -v 的三项测试通过。VGA 和 panic 定向测试通过。test_syscall_io.py 与 test_linux_descriptors.py 的宿主链接在基线和变更版均失败。
  • QEMU/KVM 的 UEFI 镜像通过 /dev/ttyS0 完整传输 192 KiB 后正常关机,BIOS 镜像在 log=none 下仍可输出 panic。
  • QEMU/KVM 在同一 initramfs、2 vCPU 和串口限速条件下测量各 240 次 fork+exec。动态可执行文件单次平均耗时由 8.17 ms 降至 0.71 ms,捕获到的串口字节数减少约 98.6%。
  • VMware 验证未完成。XFCE 启动时间待测。

Filter routine DEBUG messages by default and use consistent severity and component labels. Queue runtime serial output for IRQ-driven FIFO writes, with timer fallback, shutdown drain, and an emergency polling path.
Use the current serial source in the driver manager fixture and model the absent COM1 hooks in the PS/2 IRQ tests.
@Leonmmcoset
Leonmmcoset merged commit bdadb0b into main Nov 23, 2026
2 checks passed
@Leonmmcoset
Leonmmcoset deleted the codex/async-kernel-logging branch November 23, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants