DVD/FUSE 的 Linux 缓冲区高速缓存?
我想知道 Linux 内核中的缓冲区缓存是否存在于 UDF for DVD 和 FUSE 等文件系统中?
我试图搜索这个,但不幸的是发现的信息很少。
谢谢。
I want to know whether the buffer cache in Linux kernel is present for file systems like UDF for DVD and FUSE?
I tried to search for this but unfortunately found little information.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
缓冲区缓存将用于对块设备打开的文件句柄的任何访问,除非使用 O_DIRECT 打开文件句柄。这包括代表 FUSE 文件系统的访问。注意,如果FUSE也做了缓存(我暂时不知道),这可能会导致数据的双重缓存;与普通的内核内文件系统不同,使用 FUSE 内核无法安全地重叠页面和缓冲区缓存。在这种情况下,可能值得考虑在 FUSE 文件系统守护进程中使用
O_DIRECT
来减少缓存压力(但请务必先进行分析!)。对于内核内文件系统(例如 UDF),缓冲区高速缓存将用于所有 IO。对于包含文件数据的块,该块将同时位于缓冲区和页面缓存中(使用相同的底层内存)。在内存使用统计中,这将被视为页面缓存,而不是缓冲区缓存。
The buffer cache will be used for any access to a filehandle opened against a block device, unless the file handle is opened with
O_DIRECT
. This includes accesses on behalf of FUSE filesystems. Note that if FUSE does caching as well (I don't know offhand), this may result in double-caching of data; unlike normal in-kernel filesystems, with FUSE the kernel can't safely overlap the page and buffer caches. In this case it may be worthwhile to consider usingO_DIRECT
in the FUSE filesystem daemon to reduce cache pressure (but be sure to profile first!).For in-kernel filesystems such as UDF, the buffer cache will be used for all IO. For blocks containing file data, the block will simultaneously be in both the buffer and page caches (using the same underlying memory). This will be accounted as page cache, not buffer cache, in memory usage statistics.