Skip to contentSkip to conversation

gc_minfree_threshold

DISCUSSION Nick Ivanter 2 participants 2 messages Aug 26, 2000 – Aug 27, 2000 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

David,
I have just noticed some strange things in the code dealing with gc_minfree_threshold. I guess you added that code that is why I am addressing my questions to you.

First, when you initialize c->gc_minfree_threshold to 5% of the total Flash size, you then make sure that it is not less than a sector size. Why? Shouldn't it rather be not less than fmc->min_free_size?

Second, when you evaluate a gc starting criteria in thread_should_wake(), you compare gc_minfree_threshold with dirty_size. I guess there should be free_size instead.

Thanks,
Nick

To unsubscribe, send "unsubscribe mtd" to [email protected]

#1 lore raw
Quoted 9 lines · Nick Ivanter

David,
I have just noticed some strange things in the code dealing with gc_minfree_threshold. I guess you added that code that is why I am addressing my questions to you.

First, when you initialize c->gc_minfree_threshold to 5% of the total Flash size, you then make sure that it is not less than a sector size. Why? Shouldn't it rather be not less than fmc->min_free_size?

Yes, it probably should.

Quoted 3 lines

Second, when you evaluate a gc starting criteria in thread_should_wake(), you compare gc_minfree_threshold with dirty_size. I guess there should be free_size instead.

It was once. Between v1.44 and 1.45, this happened:
- if (nfree < c->gc_minfree_threshold)
+ if (c->fmc->dirty_size < c->gc_minfree_threshold)

Mea Culpa. I got the replacement wrong.

Actually I was thinking of dropping both of those and changing it to something like:

	if (dirty_size > free_size)
		return 1;

--
dwmw2

To unsubscribe, send "unsubscribe mtd" to [email protected]