Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2026-10-22 Akira Hayakawa <ruby.wktk@gmail.com>

* v2.2.20
* Fix build errors with 7.2 kernel
* Refactor
* Require Linux 4.18 or later
* Update copyright year

2025-07-10 Akira Hayakawa <ruby.wktk@gmail.com>

* v2.2.19
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MODULE_VERSION ?= 2.2.19
MODULE_VERSION ?= 2.2.20
DKMS_DIR := /usr/src/dm-writeboost-$(MODULE_VERSION)
DKMS_KEY := -m dm-writeboost -v $(MODULE_VERSION)

Expand Down
111 changes: 66 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,85 @@
# dm-writeboost
# dm-writeboost

![CI](https://github.com/akiradeveloper/dm-writeboost/actions/workflows/ci.yml/badge.svg)

Log-structured Caching for Linux

## Overview
dm-writeboost is originated from [Disk Caching Disk (DCD)](http://www.ele.uri.edu/research/hpcl/DCD/DCD.html).
DCD, implemented in Solaris, is an OS-level IO controller that builds logs from in-coming writes
(data and metadata) and then writes the logs sequentially similar to log-structured filesystem.
dm-writeboost implements the concept on Linux's device-mapper in more sophisticated way.
As a further extension, dm-writeboost supports read-caching which also writes data sequentially.

## Documents
- [dm-writeboost-quickstart](https://docs.google.com/presentation/d/1v-L8Ma138o7jNBFqRl0epyc1Lji3XhUH1RGj8p7DVe8/edit?usp=sharing)
- doc/dm-writeboost-readme.txt
- [dm-writeboost-internal](https://docs.google.com/presentation/d/1mDh5ct3OR-eRxBbci3LQgaTvUFx9WTLw-kkBxNBeTD8/edit?usp=sharing)

dm-writeboost is inspired by [Disk Caching Disk (DCD)](http://www.ele.uri.edu/research/hpcl/DCD/DCD.html).
Originally implemented in Solaris, DCD is an OS-level I/O controller that groups incoming writes
(data and metadata) into logs and writes them sequentially, much like a log-structured file system.
dm-writeboost brings this approach to the Linux device-mapper framework and extends it with features such as
read caching, which also writes cached data sequentially.

## Documentation

- [Quickstart](https://docs.google.com/presentation/d/1v-L8Ma138o7jNBFqRl0epyc1Lji3XhUH1RGj8p7DVe8/edit?usp=sharing)
- [Usage and reference](doc/dm-writeboost-readme.txt)
- [Internals](https://docs.google.com/presentation/d/1mDh5ct3OR-eRxBbci3LQgaTvUFx9WTLw-kkBxNBeTD8/edit?usp=sharing)
- [Wiki](https://github.com/akiradeveloper/dm-writeboost/wiki)

## Features
* **Durable**: Any power failure can't break consistency because each log consists of data, metadata and
the checksum of the log itself.
* **Lifetime**: Other caching software (e.g. dm-cache) separates data and
metadata and therefore submits writes to SSD too frequently. dm-writeboost,
on the other hand, submits only one writes for hundreds of data and
metadata updates so the SSD lives longer since SSD's lifetime depends on
how many writes are submitted.
* **Fast**: Since the sequential write is the best I/O pattern for every SSD and the code base is optimized for
in-coming random writes, the write performance is the best among all caching drivers including dm-cache and
bcache.
* **Portable**: Requires Linux kernel 4.18 or later.

- **Durable**: Each log contains data, metadata, and a checksum, allowing dm-writeboost to verify logs
and recover a consistent cache state after a power failure.
- **SSD endurance**: Batches data and metadata updates into a single log write, reducing how often
write requests are submitted to the SSD.
- **Fast**: Optimized for incoming random writes, which are combined into sequential writes to the
cache device.
- **Portable**: Requires Linux kernel 4.18 or later.

## Usage
- **Install**: `sudo make install` to install and `sudo make uninstall` to uninstall.
`sudo make uninstall MODULE_VERSION=xxx` can uninstall specific version that's installed.
DKMS is required so please install it beforehand. (usually available in package system)
- **Make a device**: Make a script to build a caching device. Please read doc/dm-writeboost-readme.txt for
the dmsetup command detail.
After reboot, you need to rebuild the caching device rather than reformatting as in the initial setup.

### Install

Install DKMS using your distribution's package manager, then run `sudo make install` to install the module.
Run `sudo make uninstall` to uninstall it. To uninstall a specific installed version, set `MODULE_VERSION`,
for example: `sudo make uninstall MODULE_VERSION=2.2.20`.

### Create a device

You can create a dm-writeboost device using either of these tools:

- `dmsetup`: See the [usage and reference guide](doc/dm-writeboost-readme.txt) for the device table format
and setup instructions.
- `writeboost-cli create`: Part of [dm-writeboost-tools](https://github.com/akiradeveloper/dm-writeboost-tools).
See its [create command documentation](https://github.com/akiradeveloper/dm-writeboost-tools#create) for examples.

You can optionally automate device creation with a script, including recreating the device mapping at boot.

### Resume after a reboot

Recreate the device mapping using the same backing device, cache device, and settings, preserving the
existing cache data. This allows dm-writeboost to replay the logs and restore the cache state.
To resume an existing cache with `writeboost-cli create`, omit `--reformat`.

## Distribution Packages
- [Debian](https://packages.debian.org/search?keywords=dm-writeboost-dkms)
- [Ubuntu](https://packages.ubuntu.com/search?keywords=dm-writeboost-dkms)

- [Debian](https://packages.debian.org/search?keywords=dm-writeboost-dkms)
- [Ubuntu](https://packages.ubuntu.com/search?keywords=dm-writeboost-dkms)

## Related Projects
* https://github.com/akiradeveloper/dm-writeboost-tools: Tools to help users analyze the state of the cache device
* https://gitlab.com/onlyjob/writeboost: A management tool including init script
* https://github.com/akiradeveloper/device-mapper-tests: Testing framework written in Rust

## Related works
* Y. Hu and Q. Yang -- DCD Disk Caching Disk: A New Approach for Boosting I/O Performance (1995)
(http://www.ele.uri.edu/research/hpcl/DCD/DCD.html)
* G. Soundararajan et. al. -- Extending SSD Lifetimes with Disk-Based Write Caches (2010)
(https://www.usenix.org/conference/fast-10/extending-ssd-lifetimes-disk-based-write-caches)
* Y. Oh -- SSD RAID as Cache (SRC) with Log-structured Approach for Performance and Reliability (2014)
(https://ysoh.files.wordpress.com/2009/05/dm-src-ibm.pdf)

- [dm-writeboost-tools](https://github.com/akiradeveloper/dm-writeboost-tools): Tools for managing dm-writeboost
devices and inspecting cache state, including `writeboost-cli`.
- [writeboost](https://gitlab.com/onlyjob/writeboost): A management tool with an init script.
- [device-mapper-tests](https://github.com/akiradeveloper/device-mapper-tests): A testing framework written in Rust.

## Related Work

- Y. Hu and Q. Yang — [DCD Disk Caching Disk: A New Approach for Boosting I/O Performance](http://www.ele.uri.edu/research/hpcl/DCD/DCD.html) (1995).
- G. Soundararajan et al. — [Extending SSD Lifetimes with Disk-Based Write Caches](https://www.usenix.org/conference/fast-10/extending-ssd-lifetimes-disk-based-write-caches) (2010).
- Y. Oh — [SSD RAID as Cache (SRC) with Log-structured Approach for Performance and Reliability](https://ysoh.files.wordpress.com/2009/05/dm-src-ibm.pdf) (2014).

## Award
Awarded by Japanese OSS Encouragement Award. Thanks!

dm-writeboost received the Japanese OSS Encouragement Award. Thank you for your support!

## License

```
Copyright (C) 2012-2025 Akira Hayakawa <ruby.wktk@gmail.com>
Copyright (C) 2012-2026 Akira Hayakawa <ruby.wktk@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -78,5 +97,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
```

## Developer Info
Akira Hayakawa (@akiradeveloper)
e-mail: ruby.wktk@gmail.com

Akira Hayakawa ([@akiradeveloper](https://github.com/akiradeveloper))

Email: ruby.wktk@gmail.com
2 changes: 1 addition & 1 deletion src/dkms.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME="dm-writeboost"
PACKAGE_VERSION="2.2.19"
PACKAGE_VERSION="2.2.20"

# Minimum supported Linux kernel version
BUILD_EXCLUSIVE_KERNEL_MIN="4.18"
Expand Down
2 changes: 1 addition & 1 deletion src/dm-writeboost-daemon.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of dm-writeboost
* Copyright (C) 2012-2025 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2026 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/dm-writeboost-daemon.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of dm-writeboost
* Copyright (C) 2012-2025 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2026 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/dm-writeboost-metadata.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of dm-writeboost
* Copyright (C) 2012-2025 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2026 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/dm-writeboost-metadata.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of dm-writeboost
* Copyright (C) 2012-2025 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2026 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/dm-writeboost-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Log-structured Caching for Linux
*
* This file is part of dm-writeboost
* Copyright (C) 2012-2025 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2026 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -1948,7 +1948,7 @@ static void writeboost_status(struct dm_target *ti, status_type_t type,

static struct target_type writeboost_target = {
.name = "writeboost",
.version = {2, 2, 19},
.version = {2, 2, 20},
.module = THIS_MODULE,
.map = writeboost_map,
.end_io = writeboost_end_io,
Expand Down
2 changes: 1 addition & 1 deletion src/dm-writeboost.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of dm-writeboost
* Copyright (C) 2012-2025 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2026 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
Loading