Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discuss related commands about famfs directory supporting native file system operations #78

Open
leeq2016 opened this issue Jul 2, 2024 · 2 comments

Comments

@leeq2016
Copy link
Contributor

leeq2016 commented Jul 2, 2024

Hi, @jagalactic

Now, file directory creation, file creation, file copy and other related operations in the famfs file system directory need to be completed with the famfs command. The reason is that when this command takes effect, a famfs log entry needs to be generated and placed in the log memory area.

Have you ever considered adding a new famfs daemon process and using ebpf to use native commands without any sense, such as: mkdir, cp, touch, etc.

Do you think this is possible? @jagalactic

@jagalactic
Copy link
Contributor

There are some hard problems in there, but I think it may be possible. One of the best simplifications in famfs, which is quite important for large shared-memory data sets, is that famfs currently never does allocate-on-write. Adding allocate-on-write (which I think would be required for cp) would likely lead to fragmented files, or increase the file creation bottleneck, or both. It would be useful if you could share some info about your use case (either here or in a private message) so I can better understand your requirements.

But there is some work that must happen first.

If you saw my talk at LSFMM (https://www.youtube.com/watch?v=nMaZhXJJgmU&list=PLbzoR-pLrL6oj1rVTXLnV7cOuetvjKn9q&index=66), you know that the maintainer of fuse is interested in merging the famfs functionality into fuse. I have been working through the implications and I think it's feasible.

The main requirement is that memory mapped files handle mapping faults as fast as anonymous mmap, which means that fuse will need to cache file-to-memory extent lists in the kernel for famfs files - the same way famfs does it now. So I'm working on hacking that functionality from famfs into fuse.

Once the initial work is done (hopefully by late August), famfs will have a fuse daemon. In the initial implementation, the famfs cli will still be required to create files, but it would become possible to support file creation via the fuse daemon. I don't have a design for that yet, and getting use case / requirements info would be helpful there.

I think we will be able to achieve excellent performance for mmap and read/write with the fuse implementation; file creation (specifically allocation and log append) require strict serialization, so there is a risk that a performant solution would add significant complexity.

Regards,
John

@leeq2016
Copy link
Contributor Author

leeq2016 commented Jul 3, 2024

Thank you for your answer.

About my use case, I tried to use famfs to share a docker image filesystem between diffrent vm, image files in famfs is used as lower dir in OVERLAYFS(this is read-only).

Due to the huge number of image files, I made some adjustments to famfs, including FAMFS_ALLOC_UNIT size, log memory area size, adding soft link support, etc., and also fixed some performance issues.
I have successfully run the container through the image file system shared by famfs now.
The feasibility of this idea was verified.👍

Regards,
Leeq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants