Operating system (OS) kernel tuning is a critical yet challenging problem for performance optimization, due to the large configuration space, complex interdependencies among configuration options, and the rapid evolution of kernel versions. Recent work has explored large language models (LLMs) for automated kernel tuning, but existing approaches often suffer from hallucinated configurations, limited interpretability, and poor robustness across workloads and kernel versions. We propose BYOS, a knowledge-driven framework that grounds LLM-based Linux kernel tuning in structured domain knowledge. BYOS incorporates three key components: (1) structured knowledge construction and mapping to bridge the semantic gap, (2) knowledge-driven configuration generation to refine the search space, and (3) continuous knowledge maintenance to adapt to kernel evolution. We evaluate BYOS on diverse workloads across multiple Linux distributions and kernel versions. Experimental results show that BYOS consistently outperforms state-of-the-art tuning baselines, achieving 7.1%-155.4% performance improvement while substantially reducing invalid configurations. These results demonstrate the effectiveness of integrating structured knowledge with LLMs for robust and scalable system optimization. The code of BYOS is available at https://github.com/LHY-24/BYOS.
翻译:操作系统内核调优是性能优化的关键但极具挑战性的问题,这源于庞大的配置空间、配置选项间复杂的相互依赖关系以及内核版本的快速演进。近期研究探索了利用大语言模型实现自动化内核调优,但现有方法常存在配置幻觉、可解释性有限,以及在不同工作负载和内核版本间鲁棒性不足的问题。本文提出BYOS,一个知识驱动的框架,将基于大语言模型的Linux内核调优建立在结构化领域知识之上。BYOS包含三个核心组件:(1)结构化知识构建与映射以弥合语义鸿沟,(2)知识驱动的配置生成以精炼搜索空间,以及(3)持续知识维护以适应内核演进。我们在多种Linux发行版和内核版本的不同工作负载上评估BYOS。实验结果表明,BYOS持续优于最先进的调优基线方法,实现了7.1%-155.4%的性能提升,同时显著减少了无效配置。这些结果证明了将结构化知识与大语言模型相结合对于实现鲁棒且可扩展的系统优化的有效性。BYOS的代码可在https://github.com/LHY-24/BYOS获取。