SSD Wear-Leveling and Fragmentation

KC_SSD

Reputable
May 15, 2014
1
0
4,510
Hello all,

I'm trying to understand the effects of wear-leveling on fragmentation in SSD. To be more specific, when the SSD controller decides to allocate a noncontiguous block to a file because of wear-leveling, the file will be fragmented.

Now, will this fragmentation be reflected in the PBA part of the addressing, or the LBA?
As an example, say File A occupies Logical Block Addresses (LBA) 10,11,12, (corresponding to PBA 300, 301, 302). The file is updated and needs an additional block. Now because of wear-leveling, lets say the next available contiguous block (PBA 303) has a high Program/Erase count, and the controller selects block with (BPA 500 --> LBA 600).
will the controller now update LBA 13 to point to BPA 500?(and therefore the no fragmentation from the point of view of the OS)? or will the file have LBA's 10, 11, 12 and 600, therefore resulting in the LBA being fragmented? (and the host OS viewing the file as fragmented)

If the file is fragmented in terms of PBA, but the mapping is done in a way where the LBA is always contiguous, then for the host OS, the file will always be contiguous.

However, I keep reading that, for example, is the case of file recovery, that one of the problems in recovering files from SSDs is that they are heavily fragmented. If that's the case, then that must mean that the fragmentation is reflected in the LBA itself.



I would really appreciate if someone can shed more light on how fragmentation actually takes place in view of BPA and LBA.

Thanks.
KC.