# 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;
  * ![](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVORxAomcgtzVVUqmws%2Fuploads%2FGhePIouz2sbEgrVnNZPn%2Fimage.png?alt=media\&token=d7e4f066-2edb-461a-afa6-a1757b8e75f1)
  * 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;

![](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVORxAomcgtzVVUqmws%2Fuploads%2FETNSfJd1v6iL0keVoyvg%2Fimage.png?alt=media\&token=b2e028c4-9a4b-4e15-9450-5765ac973fdd)

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;
