Disabling on disk write cache of SSD

andor

Distinguished
Jan 4, 2010
3
0
18,510
Hi,

I bought an MTRON PRO 7500 SATA SSD some time back and I decided to disable its on-disk write cache inorder to check its performance. I use ubuntu, and when I issued the following command:

$ sudo hdparm -W0 /dev/sdc

I received the following message

/dev/sdc:
setting drive write-caching to 0 (off)
HDIO_DRIVE_CMD(setcache) failed: Input/output error
write-caching = 1 (on)

For some reason, it is refusing to switch off the on disk write cache. I was able to disable/enable on-disk write cache of a hard disk using the hdparm command without facing any problems. So I believe this is something related to the SSD itself and its internals. Did anyone face similar problem before?


Rishi
 

andor

Distinguished
Jan 4, 2010
3
0
18,510


I'm sorry.. I'm new to this forum. I didn't see a linux subsection in storage section. So, I just created the thread in storage. If this discussion really belongs to a different section.. can anyone please help me on how to move this thread to that section?
 

andor

Distinguished
Jan 4, 2010
3
0
18,510


True, not every SSD may have a disk-write-cache. Also, I think its very difficult to guess which ones have a write cache coz we seldom know their internals. (Perhaps, by opening the device we may be able to find out .. but still we will not know whether the disk-controller uses a write-through or write-back caching scheme.)

I think the MTRON SSD does have an on-disk write cache. I wrote a program to measure the smallest latency that we see when we read/write a page. I wrote a lot of pages to /dev/sdc (opened with O_DIRECT | O_SYNC) and I found that the smallest latency observed is around 90 microseconds for both read and write. I think 90 microseconds is too small to allow page read/write from/to flash and be able to transfer it along the bus.

Also, the device was pretty expensive. When I bought it, it was 750$ for a 32GB one. (More than 20$ per gb.) I believe they have an on disk write cache coz thats the easiest way to come up with very good performance numbers. Further, most (or may be all) medium to high end SSDs will have on-disk cache to handle the "erase a block of pages, write a single page" scheme that flash-memory uses.

The MTRON's after buy support really sucks. After a lot of search, I was unable to find a phone number to call them on .. but found a technical help link where we can post a question. I posted the question of how to disable disk-write-cache 3 days back, and I haven't heard from them yet.
 

Pointertovoid

Distinguished
Dec 31, 2008
327
0
18,810
Mtron do have a cache. This is what made them better, along with the microcode.

The cache is so important to an Ssd that I can imagine Mtron's microcode refusing to disable it. For performance, but also for life expectancy.

90µs is achievable as a Flash read latency (and would be excellent still today) but by no way as a write latency (around 20ms with Slc). What you see is a Ram write, with the controller waiting to have a full block to write to Flash.