Merged
新增KAOT插件 #88
chrisffjxAdd on Sep 1
新增KAOT插件 #88
Merged
Pull Request has been successfully merged by ascend-robot.
(Thank you for chrisffjx's contribution.)Sep 1 Associated issue: [Feature]:支持KAOT插件进行os配置
atomgit-bot
Sep 1 Comments:
Sep 1 Comments:
变更摘要
本 PR 为 KAOT 新增基础系统调优能力,通过 register_feature 装饰器注册 7 个继承自 BaseFeature 的调优特性模块(均实现 get_current_config 与 _apply_config_impl),覆盖内存大页、SMT、内存过量分配、Swap、透明大页、CPU 性能模式和 I/O 队列调度器等操作系统优化项,并在各模块中完善了文件编码(encoding="utf-8")、子进程返回码检查(check=True/returncode)与异常处理。
主要改动
- 内存大页配置
config_hugepages.py:从/etc/default/grub的GRUB_CMDLINE_LINUX行解析当前hugepagesz/hugepages,校验大页规格(对比/sys/kernel/mm/hugepages支持值)和数量(对比/proc/meminfo总内存),通过update_grub_cmdline更新 GRUB 参数,并视情况向/etc/fstab追加hugetlbfs挂载项后执行grub2-mkconfig生成引导配置。 - SMT 配置
config_smt2.py:通过lscpu解析Thread(s) per core获取当前 SMT 状态,校验SMT2_status取值,检测虚机环境(systemd-detect-virt)与 920 平台型号(dmidecode),并通过_show_smt_hint输出 BIOS 手工配置指南提示。 - 内存相关调优项:新增
disable_memory_overcommit.py(校验并写入vm.zone_reclaim_mode到/etc/sysctl.conf)、disable_swap.py(校验 0–80 范围并写入vm.swappiness)、disable_transparent_hugepages.py(校验enabled/defrag合法取值,生成或修改kaot.servicesystemd 服务并执行daemon-reload/enable/start以禁用透明大页及碎片整理)。 - CPU 性能模式
enable_cpu_performance_mode.py:解析 GRUB 中现有cpufreq.default_governor参数,按内核版本(4.7+ 支持schedutil)校验调速器取值,通过_update_grub更新 GRUB 并重新生成引导配置,将 CPU 设置为performance模式。 - I/O 队列调度器优化
optimize_io_queue_scheduler.py:通过lsblk识别系统块设备,依据rotational与discard_granularity判断 SSD,将 SSD 调度策略设为none并生成/etc/udev/rules.d/io-queue-scheduler.rules规则文件,随后执行udevadm control --reload-rules与udevadm trigger重载并应用规则。


Incorrect?
atomgit-bot
Sep 1 Comments:
Sep 1 Comments:
Sep 1 Added label: ascend-cla/yes
ascend-robot
Sep 1 Comments:
Sep 1 Comments:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-Ascend/msboost | ✅ a-young-journey, LiuYongQiang0816 (2/2) | ✅ a-young-journey (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
chrisffjx, thanks for your pull request. All authors of the commits have signed the CLA. 👍


chrisffjx
Sep 1 Comments:
Sep 1 Comments:
compile


Sep 1 Added label: ci-pipeline-running
Sep 1 Removed label: ci-pipeline-running
Sep 1 Added label: ci-pipeline-passed
AtlasAccount
Sep 1 Comments:
Sep 1 Comments:
流水线 PR-pipeline_msboost#156 [ commitID:a9554f64 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 恶意代码检查 | Antipoison | ✅ COMPLETED | >>> |
| 流水线 | PR-pipeline_msboost | ✅ COMPLETED | >>> |
- compile : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


a-young-journey
Sep 2 Comments:
Sep 2 Comments:
/approve
/lgtm


Sep 2 Added label: approved
LiuYongQiang
Sep 2 Comments:
Sep 2 Comments:
/lgtm


Sep 2 Added label: lgtm
Sep 2 Merged pull request, merge node SHA: 8e9861d244e0487688919bc9c40739858f7225d5
功能说明
新增 KAOT 基础系统调优能力,覆盖内存大页、SMT、内存过量分配、Swap、透明大页、CPU 性能模式和 I/O 队列调度器等常用操作系统优化项。
主要改动
新增内存大页配置:
/etc/fstab配置。新增 SMT 配置:
新增内存相关调优项:
新增 CPU 性能模式:
新增 I/O 队列调度器优化:
完善文件编码、子进程返回码检查和异常处理。
测试结果
pre-commit 全部检查通过:
干净检出环境验证通过。
KAOT 命令行模块加载正常。
当前累计 10 个调优项自动发现和注册正常。
Python 语法编译检查通过。
GitCode 远端 Git Hooks 检查通过。
关联 Issue
Feature:支持 KAOT 插件进行 OS 配置