dlbeer / dhara

NAND flash translation layer for low-memory systems
Other
408 stars 119 forks source link

triming #16

Closed dharauser closed 2 years ago

dharauser commented 3 years ago

Hello. I am currently using dhara and I am happy with it, thank you very much. I understand that triming sectors is optional. 1 - Can you confirm that I can just ignore the trim function when I re-write a sector ? 2 - Am I going to experiment longer garbage collector phases if I don't trim the sectors as they become unused? 3 - Generally speaking, what are the consequences ? I hope my question is clear.

dlbeer commented 3 years ago

On Sun, Jan 24, 2021 at 11:27:21AM -0800, dharauser wrote:

Hello. I am currently using dhara and I am happy with it, thank you very much. I understand that triming sectors is optional. 1 - Can you confirm that I can just ignore the trim function when I re-write a sector ?

Yes, you can ignore it. It has no benefit if you intend to rewrite data on the sector anyway.

2 - Am I going to experiment longer garbage collector phases if I don't trim the sectors as they become unused?

Possibly, but it's not likely to be a problem in most applications. If the number of used sectors is below a certain ratio, then sometimes garbage collection steps can be skipped. Trimming unused sectors makes this more likely to occur.

However, even if this situation never occurs, the amount of garbage collection work per write operation is bounded to a fixed number of page rewrites.

3 - Generally speaking, what are the consequences ?

You might miss out on a performance and wear improvement in situations when the data you need to keep is a small proportion of the chip's capacity.

You can get a similar, but more consistent benefit, by using a smaller GC ratio and living with less usable space.

-- Daniel Beer dlbeer@gmail.com http://dlbeer.co.nz/ PGP: BA6E 0B26 1F89 246C E3F3 C910 1E58 C43A 160A 553B