# High Velocity Kernel File Systems with Bento

* Kernel File System Development is slow&#x20;
  * High development and deployment velocity are critical to modern cloud systems&#x20;
  * Linux kernel development and deployment are slow
  * File systems are particularly affected due to advances in storage hardware and new demands by cloud systems&#x20;
* Existing techniques aren't efficient&#x20;
  * ![](/files/Z60Ek0ooYANjG5Zzpljd)
  * eBPF: in-kernel VM that runs user-provided program at pre-specified points, but quite restricted&#x20;
* Goals
  * High performance: has low performance overhead
  * Safety: prevention of bugs in the file system
  * General programmability: supports a wide variety of potential file systems&#x20;
  * Compatibility: works with Linux and existing Linux binaries&#x20;
  * Live Upgrade: can redeploy file systems without service downtime&#x20;
  * User-level debugging: file system can be debugged easily with a variety of tools&#x20;
  * Open Source&#x20;
* Bento
  * File systems are implemented in safe Rust
    * Imposes little overhead and supports most designs&#x20;
  * How can we integrate a safe Rust system in the kernel?
  * How can we dynamically replace the file system?
  * How can we support user-level execution?&#x20;

![](/files/r1AnDgh7ff42nDFM8SOi)

BentoFS&#x20;

* Standalone C kernel module that hooks into VFS
* Maintains an active list of file systems&#x20;
* Translate VFS calls to FUSE low-level API&#x20;
* Forwards call to the correct FS&#x20;

FS module&#x20;

* Contains the file system and two Rust libraries: libBentoFS and libBentoKS

libBentoFS

* Between BentoFS and the file system&#x20;
* Converts unsafe C from BentoFS to safe Rust
  * Converts C types to Rust types
  * Converts pointers to references&#x20;

libBentoKS

* Between the file system and the rest of the kernel
* Provides access to efficient, well-tested kernel services
* Provides safe abstractions around kernel services&#x20;
  * Ensures correct ownership
  * Handles resource allocation and deallocation&#x20;

Live Upgrade

* Live upgrade component in BentoFS
* When an upgrade module is inserted
  * BentoFS stop calls to the file system
  * Old file system cleans up and returns state struct&#x20;
  * New file system initializes using state and returns&#x20;
  * BentoFS swaps pointers and allows calls to proceed&#x20;

Userspace Execution&#x20;

* Bento file system can be run in userspace without any changes to the code
* Most interfaces provided by libBentoFS and libBentoKS are identical to existing userspace interfaces&#x20;
* File system can be compiled to run in userspace using a build flag&#x20;

Evaluation&#x20;

* Competitive performance?
* How does live upgrade impact availability?&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sliu583.gitbook.io/blog/specific-work/seminar-and-talk/fall-21-reading-list/high-velocity-kernel-file-systems-with-bento.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
