fix(ext4): batch metadata writeback while preserving sync semantics (#2271)
- fix(ext4): batch metadata writeback while preserving sync semantics
Small filesystem operations currently pay the complete journal flush protocol on the foreground path. Introduce bounded metadata publication and background batch commits so independent operations share that cost without weakening fsync, fdatasync, syncfs or block-reuse ordering.
- Centralize metadata access and operation publication across namespace, allocation, extent, xattr and delayed-allocation paths. Keep one running and at most one frozen batch, with bounded credits and a 100 ms deadline.
- Preserve the existing five-flush journal protocol and defer retired block and inode reuse until checkpoint and clean-tail persistence complete.
- Separate journal I/O from completion callbacks, reserve completion capacity before publication, and retain accepted ownership on asynchronous failures.
- Add generation-specific Submitted page-cache completion, finite sync targets, error reporting and worker draining during final unmount.
- Share ext4 state and superblock lifecycle across same-device mounts. Keep metadata readers coherent with the inode cache and prevent reader traffic from starving writers or unnecessarily waking background workers.
- Correct external-xattr hashes and block accounting, directory growth accounting, and fragmented-reclaim credit budgeting.
- Add guest regression coverage and real-image tests for batching, delayed allocation, namespace recovery, fragmented reclaim and cache concurrency.
Validation:
- Kernel build passed; 183 lower-level unit tests passed.
- 76 guest tests and Submitted/accounting self-tests passed.
- 124 namespace write/flush crash points recovered with clean e2fsck results.
- Real-image batching, delayed-allocation failure, fragmented-reclaim and inode-cache concurrency checks passed.
- Five-round 100 x 4 KiB benchmark including both syncfs boundaries reduced median total time from 3.662096 s to 2.717986 s.
Existing orphan-list scanning can still cause long tails under sustained unlink workloads. Global allocator OOM injection was not exercised.
Signed-off-by: longjin longjin@dragonos.org
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
轻量级云原生内核
DragonOS
Languages 中文|English
DragonOS龙操作系统是一个面向云计算轻量化场景的,完全自主内核的,提供Linux二进制兼容性的64位操作系统,旨在为容器化工作负载提供轻量级、高性能的解决方案。它使用Rust语言进行开发,以提供更好的可靠性。
DragonOS开源社区成立于2022年7月,完全商业中立。我们热烈欢迎感兴趣的开发者和爱好者加入我们!
DragonOS具有优秀的、完善的架构设计。相比于同体量的其他系统,DragonOS支持eBPF、虚拟化。当前正在大力推进容器支持、云平台支持、riscv支持等工作,以及编译器、应用软件的移植。力求在5年内实现生产环境大规模应用。
DragonOS目前在社区驱动下正在快速发展中,目前DragonOS已经实现了约1/4的Linux接口,在未来我们将提供对Linux的100%兼容性,并且提供新特性。
🌟 想要快速体验DragonOS? 访问 DragonOS Playground 即可在云端零配置一键启动DragonOS,体验最新的nightly build版本!
📰 社区新闻
如何运行?
🌟 方法一:云原生开发(推荐)
零配置、一键启动! 在CNB云原生开发平台上体验DragonOS是最简单快捷的方式,无需本地安装任何依赖!
方法二:本地构建运行
如果您希望在本地环境中构建和运行DragonOS,可以参考以下文档:
参与开发?
仔细阅读 DragonOS社区介绍文档 ,能够帮助你了解社区的运作方式,以及如何参与贡献!
如果你愿意加入我们,你可以查看issue,并在issue下发表讨论、想法,或者访问DragonOS的论坛,了解开发动态、开发任务: https://bbs.dragonos.org.cn
你也可以带着你的创意与想法,和社区的小伙伴一起讨论,为DragonOS创造一些新的功能。
站点
如何与社区建立联系?
请阅读贡献者指南~
贡献者名单
Contributors to DragonOS-Community/DragonOS · GitHub
赞助
DragonOS是一个公益性质的开源项目,它的发展离不开资金的支持,所有的赞助者的名单都会被公示。您的每一分赞助,都会为DragonOS的发展作出贡献!
赞助的资金都会被用到哪里?
我们保证,所有赞助的资金及物品,将会用于:
🌟 赞助商列表
Special thanks to these generous financial supporters (in reverse chronological order):
CDN 赞助商
本项目的CDN加速和安全防护由腾讯EdgeOne赞助。
个人赞赏者列表
请见 Supporters.md
开放源代码声明
本项目采用GPLv2协议进行开源,欢迎您在遵守开源协议的基础之上,使用本项目的代码!
若您发现了任何违背开源协议的使用行为,我们欢迎您发邮件到 pmc@dragonos.org 反馈!让我们共同建设诚信的开源社区。
👩💻 Contributors