cxl-micron-reskit / famfs

This is the user space repo for famfs, the fabric-attached memory file system
Apache License 2.0
31 stars 9 forks source link

Does famfs provide POSIX-like interfaces for operating files under the famfs file system, such as open, close, write, read, lseek, and other functions? #47

Closed lordiscat closed 4 months ago

lordiscat commented 4 months ago

Does famfs provide POSIX-like interfaces for operating files under the famfs file system, such as open, close, write, read, lseek, and other functions?

jagalactic commented 4 months ago

Yes, with some limitations:

The most interesting use case for famfs is mmap(). If you memory map a famfs file, you are directly accessing the memory. Unlike conventional mmap, famfs does not demand-page data from a backing device (e.g. SSD) into the page cache. If you access an address from a memory mapped famfs file, the memory is accessed directly; cache lines are loaded into the processor cache directly from the memory.

Back to the question, If a file already exists, you can use any of the posix calls, with the following limitations:

Creating a file is special, because famfs never does allocate-on-write. So you need to use the famfs CLI or API:

One way to think about it is that creating a famfs file is analogous to allocating memory that can be referenced via the file.

Also, if you are using a shared-memory dax device, only the host that created the filesystem can create files. This is because both memory allocation and metadata log append must be serialized.

Many of the current limitations can be relaxed or eliminated if use cases justify adding complexity to famfs.

Hope this helps. Let me know if you have more questions.

John