[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Background garbage collection



Bob has implemented garbage collection in a kernel thread, and I've tweaked 
a few things. 

We now have a kernel thread which sleeps until either the free space is 
below a certain threshold, or the dirty space is above another threshold.

When it does wake, it performs only one call to jffs_garbage_collect_next() 
before evaluating whether it needs to run again. 

JFFS operations which need more space on the filesystem than the 
gc_minfree_threshold will need to call jffs_garbage_collect_now() to make 
space, if it isn't already there. jffs_garbage_collect_now is the routine 
formerly known as jffs_garbage_collect(). I think we want to add a 
'required_space' argument to it, though, rather than just running till it 
can't GC any more. 

Anyone want to take a look and offer their opinion of it?

--
dwmw2