4

I'm currently working on a custom test/benchmark for SSD (CFast card) that runs on Win10 (written in C++). Part of the job is to read and interpret the S.M.A.R.T. attributes reported by the SSD. The one I'm interested in now is called "Total Host LBAs written", i.e. the number of LBAs written by the host system. The information I'm missing is "what is the size of memory one LBA refers to, in bytes?". I have done some homeworks on how SSDs internally work, but I'm a bit confused in here and would hope somebody could shed some light on this, I am obviously missing something:

  1. The FTL (Flash Translation Layer) in the SSD performs, amongst other operations (wear-leveling, garbage-collection etc.), LBA-to-physical address mapping.
  2. The smallest memory unit that is individually readable/writable in SSD is a page. In my case, the page is said to have 16KiB of size. From this I would naively conclude that the LBA size will be the same as page size, i.e. 16KiB (or its integer multiple).
  3. On the other hand, I would expect that the LBA will have the size of "sector" reported by GetDiskFreeSpace() from WinAPI, which reports 512B (with "SectorsPerCluster" = 8).

So, where am I thinking wrong and what is the real LBA size I can count with (or how can I get its value)? If the LBA size would be 512B (or 8*512 = 4KiB), the LBA would refer to 1/32 (1/4) of my flash page, which seems inefficient. I understand there's a need of emulation of older storages, but if it's allowed to write a single LBA, what does the SSD do then? Does it cache the whole page, rewrite the 1/32 part corresponding to the LBA, write it to empty block and update the LBA-physical address table?

Edit: sorry for using "LBA size", I know it's not semantically 100% correct, hopefully it's understandable...

  • _In my case, the page is said to have 16KiB of size. From this I would naively conclude that the LBA size will be the same as page size..._ I would agree. This certainly makes sense to me. _Does it cache the whole page, rewrite the 1/32 part corresponding to the LBA, write it to empty block and update the LBA-physical address table?_ I think it must do, yes, what else can it do? Here is just a _totally_ confusing link, I don't even know why I'm posting it, but there doesn't actually seem to be any decent information out there: https://www.virten.net/2016/12/ssd-total-bytes-written-calculator/ – Paul Sanders Jul 17 '18 at 06:31
  • @PaulSanders Thanks for the link, I've seen it earlier and it's indeed not very helpful. I also found this presentation: https://www.flashmemorysummit.com/English/Collaterals/Proceedings/2012/20120821_TB12_Cohen.pdf On page 7, there are sub-page FTLs mentioned (and also Variable sized FTLs). The thing that just doesn't seem natural to me is that the logical block size would be smaller than physical one (although I understand that 16k logical blocks would lead to high write amplification). In the end, it would make more sense if the SSD would report total host writes in bytes... – JindraPompo Jul 17 '18 at 07:28
  • Sorry, you're way ahead of me, but I imagine that logical blocks are always written out in their entirety. – Paul Sanders Jul 17 '18 at 23:12

0 Answers0