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

mounting /mnt/vmtest with 9pfs cache=mmap option #61

Closed
chantra opened this issue Feb 1, 2024 · 3 comments · Fixed by #62
Closed

mounting /mnt/vmtest with 9pfs cache=mmap option #61

chantra opened this issue Feb 1, 2024 · 3 comments · Fixed by #62

Comments

@chantra
Copy link
Collaborator

chantra commented Feb 1, 2024

It seems /mnt/vmtest mount is mounted with "cache=loose" option since ea62161

One issue with cache=loose, is that the guest does not revalidate from the host, and based on the 9p documentation it seems it should be use for RO filesystem?

https://wiki.qemu.org/Documentation/9p_root_fs#Boot_the_9p_Root_FS_System goes over this. It seems cache=mmap is the least required to have a functional system.

It becomes useful when paired with the interactive mode as this would allow, for instance, to iterate on bpf selftests (from the host) and quickly re-run them in the guest without the need to reboot. See https://chantra.github.io/bpfcitools/bpf-local-development.html

WDYT?

@danobi
Copy link
Owner

danobi commented Feb 2, 2024

Agreed, looks like cache=loose is a bug now that it's not RO.

But it's not clear to me the difference between cache=none and cache=mmap. If mmap works for you then I suppose it's fine.

@chantra
Copy link
Collaborator Author

chantra commented Feb 2, 2024

The wiki says:

Note: you need to use at least cache=mmap with the command above. That's actually not about performance, but rather allows the mmap() call to work on the guest system at all. Without this the guest system would even fail to boot, as many software components rely on the availability of the mmap() call.

so it seems it is desirable to enable it. I take this statement does not apply to only the rootfs.

@danobi
Copy link
Owner

danobi commented Feb 2, 2024

Ah I see that in the qemu wiki now. Somewhat odd semantics... but sounds like cache=mmap is what we want

chantra added a commit to chantra/danobi-vmtest that referenced this issue Feb 2, 2024
cache=loose or cache=fscache currently do not validate via host, which means that a file modified on the host does not mirror back in the guest without doing some deletion dance....

https://lore.kernel.org/lkml/CAFkjPTmVbyuA0jEAjYhsOsg-SE99yXgehmjqUZb4_uWS_L-ZTQ@mail.gmail.com/ 

mmap mode seems to be needed for `mmap` to actually work per https://wiki.qemu.org/Documentation/9p_root_fs#Boot_the_9p_Root_FS_System

Fixes danobi#61
chantra added a commit that referenced this issue Feb 2, 2024
cache=loose or cache=fscache currently do not validate via host, which means that a file modified on the host does not mirror back in the guest without doing some deletion dance....

https://lore.kernel.org/lkml/CAFkjPTmVbyuA0jEAjYhsOsg-SE99yXgehmjqUZb4_uWS_L-ZTQ@mail.gmail.com/ 

mmap mode seems to be needed for `mmap` to actually work per https://wiki.qemu.org/Documentation/9p_root_fs#Boot_the_9p_Root_FS_System

Fixes #61
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

Successfully merging a pull request may close this issue.

2 participants