如何确保数据绕过内存/缓存/缓冲IO到达存储? [英] How to ensure data reaches storage, bypassing memory/cache/buffered-IO?
本文介绍了如何确保数据绕过内存/缓存/缓冲IO到达存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Linux中,如何确保我的系统write()调用(以及类似的write-IO调用/变量)绕过内存/缓存/缓冲的IO到达非易失性存储?
In Linux, how to ensure my system write() calls (and similar write-IO calls/variants) reach non-volatile storage, bypassing memory/cache/buffered-IO?
推荐答案
请参见"确保数据到达磁盘 ."
简而言之,最安全的策略是在适当的时候使用O_DIRECT + fsync().
In short, the safest policy is O_DIRECT + fsync() at appropriate points.
这篇关于如何确保数据绕过内存/缓存/缓冲IO到达存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文