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

Re: Killing JFFS under 2.2

scote1@xxxxxxx.com said:
>  Looking at your log, I'll have to agree with your GC affirmation.
> After the 2 "Cool stuff's happening!", we should have a
> jffs_garbage_collect_next(): "libncurses.so.4.2", ino:42, version: 25

> Right where the problem happens!  Maybe we should take a look at
> jffs_rewrite_data()

I think it's a write of a new node which is getting interleaved with the GC.

Something like:

	Thread 1 (GC)			Thread 2 (write)
	-------------			----------------

	allocate space for ino:42,v25
	write ino:42, v25
					allocate space for new 8K node
					lose CPU somehow
	allocate space for ino:42,v26
	write ino:42, v26
	... write lots more....

					... still waiting for CPU...
					... want to write new 8K node 
						which was alloc'd ...

If I'm right, then I see two possible fixes - either stick a big mutex 
around the (allocate,write) code, or have all node writes done sequentially 
from a single kernel thread.