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

min_free_size again.




The really annoying thing about the empirical method is that you can never 
be sure it's working - only when it's broken.

Could someone verify my maths?

In the third round, extra_available is -8. (Well, it would be if it wasn't 
unsigned. I've fixed that now so we won't write a max_chunk_size node in 
that situation.)

The question is - _why_ is it -8?

We have a built-in security of max_chunk_size to deal with this kind of thing,
so it's OK for it to be negative occasionally - but I want to know why.

We have to keep track of all possible reasons for it to be negative, and 
build in enough slack to cope if all of them happen at once.


thread_should_wake(): free=92572, dirty=1209148, blocksize=131072.
   jffs_garbage_collect_now(): erased: 0
***jffs_garbage_collect_now(): round #9, fmc->dirty_size = 1209148
jffs_garbage_collect_next(): "file3", ino: 2337, version: 2, location 0x59664, dsize 1260
Reducing size of new node from 65536 to 1328 to avoid catching our tail
space_needed = 92572, extra_available = 0
***jffs_rewrite_data(): node: 2337, name: "file3", size: 1260


thread_should_wake(): free=91244, dirty=1217400, blocksize=131072.
   jffs_garbage_collect_now(): erased: 0
***jffs_garbage_collect_now(): round #10, fmc->dirty_size = 1217400
jffs_garbage_collect_next(): "file3", ino: 2337, version: 3, location 0x5b6a0, dsize 8192
Reducing size of new node from 65536 to 15184 to avoid catching our tail
space_needed = 84320, extra_available = 6924
***jffs_rewrite_data(): node: 2337, name: "file3", size: 15116


thread_should_wake(): free=76060, dirty=1225652, blocksize=131072.
   jffs_garbage_collect_now(): erased: 0
***jffs_garbage_collect_now(): round #11, fmc->dirty_size = 1225652
jffs_garbage_collect_next(): "file3", ino: 2337, version: 4, location 0x5d6dc, dsize 1268
***jffs_rewrite_data(): node: 2337, name: "file3", size: 65468
thread_should_wake(): free=10524, dirty=1291668, blocksize=131072.
   jffs_garbage_collect_now(): erased: 0

--
dwmw2