Documentation/translations/zh_CN/process/3.Early-stage.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_CN/process/3.Early-stage.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_CN/process/3.Early-stage.rst- Extension
.rst- Size
- 9397 bytes
- Lines
- 169
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
.. include:: ../disclaimer-zh_CN.rst
:Original: :ref:`Documentation/process/3.Early-stage.rst <development_early_stage>`
:Translator:
时奎亮 Alex Shi <alex.shi@linux.alibaba.com>
:校译:
吴想成 Wu XiangCheng <bobwxc@email.cn>
.. _cn_development_early_stage:
早期规划
========
当考虑一个Linux内核开发项目时,很可能会直接跳进去开始编码。然而,与任何重要
的项目一样,许多成功的基础最好是在第一行代码编写之前就打下。在早期计划和
沟通中花费一些时间可以在之后节省更多的时间。
搞清问题
--------
与任何工程项目一样,成功的内核改善从清晰描述要解决的问题开始。在某些情况
下,这个步骤很容易:例如当某个特定硬件需要驱动程序时。不过,在其他情况下,
很容易将实际问题与建议的解决方案混在一起,这可能会导致麻烦。
举个例子:几年前,Linux音频的开发人员寻求一种方法来运行应用程序,而不会因
系统延迟过大而导致退出或其他问题。他们得到的解决方案是一个连接到Linux安全
模块(LSM)框架中的内核模块;这个模块可以配置为允许特定的应用程序访问实时
调度程序。这个模块被实现并发到linux-kernel邮件列表,在那里它立即遇到了麻烦。
对于音频开发人员来说,这个安全模块足以解决他们当前的问题。但是,对于更广泛的
内核社区来说,这被视为对LSM框架的滥用(LSM框架并不打算授予他们原本不具备的
进程特权),并对系统稳定性造成风险。他们首选的解决方案包括短期的通过rlimit
机制进行实时调度访问,以及长期的减少延迟的工作。
然而,音频社区无法超越他们实施的特定解决方案来看问题;他们不愿意接受替代方案。
由此产生的分歧使这些开发人员对整个内核开发过程感到失望;其中一个开发人员返回
到audio列表并发布了以下内容:
有很多非常好的Linux内核开发人员,但他们往往会被一群傲慢的傻瓜所压倒。
试图向这些人传达用户需求是浪费时间。他们太“聪明”了,根本听不到少数
人的话。
(http://lwn.net/Articles/131776/)
实际情况却是不同的;与特定模块相比,内核开发人员更关心系统稳定性、长期维护
以及找到问题的正确解决方案。这个故事的寓意是把重点放在问题上——而不是具体的
解决方案上——并在开始编写代码之前与开发社区讨论这个问题。
因此,在考虑一个内核开发项目时,我们应该得到一组简短问题的答案:
- 需要解决的问题究竟是什么?
- 受此问题影响的用户有哪些?解决方案应该解决哪些使用案例?
- 内核现在为何没能解决这个问题?
只有这样,才能开始考虑可能的解决方案。
早期讨论
--------
在计划内核开发项目时,在开始实施之前与社区进行讨论是很有意义的。早期沟通可以
通过多种方式节省时间和麻烦:
- 很可能问题是由内核以您不理解的方式解决的。Linux内核很大,具有许多不明显
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.