zfs 对映射文件的内存使用

Memory usage of zfs for mapped files

我在 https://blogs.oracle.com/roch/entry/does_zfs_really_use_more

上阅读了以下内容

There is one peculiar workload that does lead ZFS to consume more memory: writing (using syscalls) to pages that are also mmaped. ZFS does not use the regular paging system to manage data that passes through reads and writes syscalls. However mmaped I/O which is closely tied to the Virtual Memory subsystem still goes through the regular paging code . So syscall writting to mmaped pages, means we will keep 2 copies of the associated data at least until we manage to get the data to disk. We don't expect that type of load to commonly use large amount of ram

这到底是什么意思?这是否意味着 zfs 将 "uselessly" 双重缓存由内存映射文件支持的任何内存区域?或者 "using syscalls" 是否意味着使用我不熟悉的其他写作方法写作。 如果是这样,我是否最好将以这种方式编写的文件的工作目录保留在 ufs 分区上?

Does this mean that zfs will "uselessly" double cache any memory region that is backed by a memory mapped file?

希望不会。

or does "using syscalls" mean writing using some other method of writing that I am not familiar with.

该方法只是常规的低级 write(fd, buf, nbytes) 系统调用和类似方法,而不是内存映射文件旨在支持的内容:通过使用指针读取/写入内存来访问文件内容,将文件数据用作一个字节数组或其他什么。

If so, am I better off keeping the working directories of files written this way on a ufs partition?

不,除非同样使用系统调用写入的内存映射文件总计占您 RAM 工作负载的很大一部分,这不太可能发生。

PS:请注意,这个博客已经快十年了。从那时起,实施可能发生了变化。