Add support for Discard operations

Open
#1,931 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

Research direction

No files or tests are named. Start by tracing how Crucible handles Discard operations and how those operations reach the underlying files, using the local-storage behavior described in the issue as context. Done means Discard is plumbed through Crucible and the underlying files receive the intended fcntl(F_FREESP) handling.

Written by the indexing model from the issue text.

Description

With the support of NVMe Discard operations introduced by https://github.com/oxidecomputer/propolis/pull/1105, Propolis accepts Discard operations for all disk types. For local storage, the Discard operation is passed down to the ZFS raw zvol via ioctl(DKIOCFREE), which will issue a Discard on the underlying physical SSD. But for Crucible disks, the Discard operation is a no-op. We should consider plumbing the Discard operation through Crucible and having it issue a fcntl(F_FREESP) to the underlying files.

The benefit of processing the Discard is similar for local storage and Crucible: although it doesn't make the space available to other uses (because the space that may potentially be used for the Crucible disk remains reserved), it reduces the allocation and fragmentation burden on the underlying subsystem (the SSD's FTL in the case of local storage, or ZFS's metaslab allocator in the case of Crucible).

Dominant language
Rust
Stars
260
Forks
34
Avg merge
2d 1h
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from oxidecomputer/crucible

All issues in oxidecomputer/crucible

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.