Page MenuHomeFreeBSD

ufshci: Add WriteBooster support
ClosedPublic

Authored by jaeyoon on Aug 14 2025, 7:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 12:01 AM
Unknown Object (File)
Fri, Oct 10, 5:36 PM
Unknown Object (File)
Fri, Oct 10, 12:26 PM
Unknown Object (File)
Fri, Oct 10, 12:26 PM
Unknown Object (File)
Fri, Oct 10, 12:26 PM
Unknown Object (File)
Fri, Oct 10, 12:26 PM
Unknown Object (File)
Fri, Oct 10, 5:39 AM
Unknown Object (File)
Fri, Oct 10, 2:12 AM
Subscribers

Details

Summary

This patch enables WriteBooster to improve write performance. It
reserves SLC space from normal (TLC) storage to handle incoming
writes, reducing latency and handling bursty writes.

The buffer can be dedicated to a single LU or shared across
multiple LUs, depending on configuration. Data staged in SLC is
later flushed back to TLC automatically or on demand, without
changing data placement.

The following table shows WriteBooster performance as tested on a
Galaxy Book S + UFS 4.0(HS-GEAR 4) device.

----------------------------------------------------------------
|     Workload      |  BS  | QD | WriteBooster |   Bandwidth   |
----------------------------------------------------------------
| Sequential Write  |  1MB | 32 |    On        |    1568 MiB/s |
| Sequential Write  |  1MB | 32 |    Off       |     556 MiB/s |
----------------------------------------------------------------

Also, this function adds a power mode change quirk to the Intel
Lakefield UFS controller.

Sponsored by: Samsung Electronics

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jaeyoon edited the summary of this revision. (Show Details)

One question, and one minor problem... Otherwise, I think this is fine. It's a feature that's enable on attach and then everything about it happens automatically, right?

sys/dev/ufshci/ufshci_dev.c
717

How much will these debug printfs spam the log?
I'm guessing 'once on boot' since this is called from the construct function, but I've not studied enough to know if this is called repeatedly or not.

778

On FreeBSD, we have all files end in a newline.

In D51893#1193102, @imp wrote:

One question, and one minor problem... Otherwise, I think this is fine. It's a feature that's enable on attach and then everything about it happens automatically, right?

Yes, once WriteBooster is enabled everything happends automatically.
The only additional consideration is flushing the WriteBooster buffer during suspend.
This will be addressed when implementing suspend/resume support.

sys/dev/ufshci/ufshci_dev.c
717

Yes, that’s correct! They should only print once on boot.

jaeyoon added inline comments.
sys/dev/ufshci/ufshci_dev.c
778

Done!

add a newline at end of file

This revision is now accepted and ready to land.Aug 31 2025, 6:36 PM
This revision was automatically updated to reflect the committed changes.