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

Add filesystem UIO driver #142

Closed
wants to merge 10 commits into from
Closed

Add filesystem UIO driver #142

wants to merge 10 commits into from

Conversation

dreamliner787-9
Copy link
Contributor

This PR adds:

  • Filesystem UIO driver to libvmm to allow creation of Filesystem VMs. Allowing native clients to use any filesystems supported by Linux streamed in from a native block device driver.
  • A dependancy to liburing.

The basic idea is:

  • The client filesystem command queue, completion queue and data region are mapped into the guest's userspace via UIO.
  • Then, the Filesystem UIO driver dequeues all the commands and map it into the corresponding Linux FS calls.
  • Via io_uring, the driver will enqueue all the Linux FS calls into io_uring's submission queue and signal the kernel. io_uring was used to improve performance by allowing us to perform multiple I/O operations with only 1 syscall.
  • The driver will wait for all SQEs (Submission Queue Entry) to complete. Then for each CQE (Completion Queue Entry), a callback is invoked to enqueue the completion message to the native client's completion queue.
  • The driver finally faults on a pre-determined physical address for the VMM to signal the native FS client.

Note:

  1. Not all FS calls go through io_uring. This includes:
    • Mount/unmount.
    • Truncate.
    • Directory calls (FS_CMD_DIR_*)
      For these calls, the driver will "flush" the io_uring submission queue, wait for the flushed operations to finish and invoke the required operation. Acting as a barrier to ensure correctness in mixing synchonrous and asynchronous operations.

@Ivan-Velickovic
Copy link
Collaborator

Why do we need a dependency?

@dreamliner787-9
Copy link
Contributor Author

Why do we need a dependency?

It is a wrapper library around the raw io_uring syscalls that the FS driver needs, without it, we would need to manually map queues memory and manage them

@Ivan-Velickovic
Copy link
Collaborator

How difficult is it to do that? I would really like to avoid adding any more dependencies.

@dreamliner787-9
Copy link
Contributor Author

How difficult is it to do that? I would really like to avoid adding any more dependencies.

It is possible, but will be time consuming, error-prone and make the code harder to read as we would have to manipulate the raw shared data structures with the kernel, submission/completion queues and its objects, and put memory barriers at the correct place for every operation.

@Ivan-Velickovic
Copy link
Collaborator

This driver is for LionsOS and should not be in libvmm then.

@Ivan-Velickovic
Copy link
Collaborator

It is possible, but will be time consuming, error-prone and make the code harder to read as we would have to manipulate the raw shared data structures with the kernel, submission/completion queues and its objects, and put memory barriers at the correct place for every operation.

Okay I'll have to have a look at how complicated it is.

@Ivan-Velickovic
Copy link
Collaborator

I'll close the PR since it should be going to LionsOS.

libvmm is supposed to be OS agnostic.

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 this pull request may close these issues.

2 participants