---

The trouble with discard

“The “discard” concept was added to the kernel one year ago to
communicate this information to storage devices. One year later, it
seems that the original discard idea will not survive contact with
real hardware – especially solid-state storage devices.

“There are a number of use cases for the discard functionality.
Large, “enterprise-class” storage arrays can implement virtual
devices with a much larger storage capacity than is actually
installed in the cabinet; these arrays can use information about
unneeded blocks to reuse the physical storage for other data. The
compcache compressed in-memory swapping mechanism needs to know
when specific swap slots are no longer needed to be able to free
the memory used for those slots. Arguably, the strongest pressure
driving the discard concept comes from solid-state storage devices
(SSDs). These devices must move data around on the underlying flash
storage to implement their wear-leveling algorithms. In the absence
of discard-like functionality, an SSD will end up shuffling around
data that the host system has long since stopped caring about;
telling the device about unneeded blocks should result in better
performance.”

Complete Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis