libkrun icon indicating copy to clipboard operation
libkrun copied to clipboard

Bring back DAX

Open hoshinolina opened this issue 1 year ago • 5 comments

Re-add the shmem region required for DAX again (after it got removed when virtio-gpu was implemented), and enable DAX.

hoshinolina avatar Jul 06 '24 14:07 hoshinolina

Hey @asahilina, what's the best way to test that DAX is working again?

dgageot avatar Jul 07 '24 17:07 dgageot

The kernel will try to use it unconditionally if the mount flag is present (that's how I figured out what was missing, enabling DAX just broke everything until I got it right).

I haven't truly tested it end to end though, but I'll find out soon enough if it's working as advertised since a use case I'm interested in relies on coherent /dev/shm memory mappings between the host and the guest. ^^

On July 8, 2024 2:10:41 AM GMT+09:00, David Gageot @.***> wrote:

Hey @asahilina, what's the best way to test that DAX is working again?

-- Reply to this email directly or view it on GitHub: https://github.com/containers/libkrun/pull/205#issuecomment-2212512055 You are receiving this because you were mentioned.

Message ID: @.***>

hoshinolina avatar Jul 08 '24 07:07 hoshinolina

The kernel will try to use it unconditionally if the mount flag is present (that's how I figured out what was missing, enabling DAX just broke everything until I got it right). I haven't truly tested it end to end though, but I'll find out soon enough if it's working as advertised since a use case I'm interested in relies on coherent /dev/shm memory mappings between the host and the guest. ^^

Thanks a lot! If I understand correctly, your use case is using DAX on the boot "disk" that's over virtiofs. I'm interested in using DAX on virtiofs mounts for file sharing between the host and the guest and couldn't see a difference with this PR. But it's more than possible that I understood it wrong or that I'm doing it wrong.

dgageot avatar Jul 08 '24 07:07 dgageot

You need to set the "dax" mount option on your mount, as the last commit (revert) does for the root filesystem. If that works and the flag shows up in /proc/mounts then it should be working as far as I know!

On July 8, 2024 4:23:23 PM GMT+09:00, David Gageot @.***> wrote:

The kernel will try to use it unconditionally if the mount flag is present (that's how I figured out what was missing, enabling DAX just broke everything until I got it right). I haven't truly tested it end to end though, but I'll find out soon enough if it's working as advertised since a use case I'm interested in relies on coherent /dev/shm memory mappings between the host and the guest. ^^

Thanks a lot! If I understand correctly, your use case is using DAX on the boot "disk" that's over virtiofs. I'm interested in using DAX on virtiofs mounts for file sharing between the host and the guest and couldn't see a difference with this PR. But it's more than possible that I understood it wrong or that I'm doing it wrong.

-- Reply to this email directly or view it on GitHub: https://github.com/containers/libkrun/pull/205#issuecomment-2213228182 You are receiving this because you were mentioned.

Message ID: @.***>

hoshinolina avatar Jul 08 '24 08:07 hoshinolina

Thank! Yes, that's what I did and in does support the dax mount option now, whereas it didn't before. I didn't see any difference on the performance, though.

dgageot avatar Jul 08 '24 08:07 dgageot

This one got superseded by #212

slp avatar Sep 11 '24 07:09 slp