JFFS3 & performance

Jörn Engel joern at wohnheim.fh-wedel.de
Tue Jan 25 05:51:40 EST 2005


On Fri, 21 January 2005 14:04:31 +0000, Artem B. Bityuckiy wrote:
> > 
> > none
> > 	c->alloc_sem
> > 		f->sem
> RULE: Can not have any f->sem locked if gonna lock f->alloc_sem.

Or c->erase_completion_lock if you want to lock either of the above.
Or c->inocache_lock if you want to lock either of the above.

As a very simple statical deadlock checker, you can draw a graph of
all locks, like I did.  If the graph has cycles, deadlock situations
are possible.

> > 			c->erase_completion_lock
> > 				c->inocache_lock
> > 	c->erase_free_sem
> > 	c->gc_thread_start
> > 
> > 
> > 
> > Protected data structures:
> > 
> > f->sem
> > 	everything inside f?
> Yes. Also if you have f->sem seems you may change f->inocache fields 
> without having c->inocachelock.

That could be a problem.  Will take a while before I can check it.

> > c->alloc_sem
> > 	everything in c but the below?
> No. In essence f->alloc_sem protects flash space. Believe this mutex is 
> misnamed. And tends to lock code, not data.

Since that code writes to flash, it does protect data.  Makes sense,
although one could possibly move the lock down to individual erase
blocks.

> > c->erase_completion_lock
> Misnamed either. David said this is historical. Protects 
> node_ref list.

Ok.

> > 	c->free_list
> > 	c->erasing_list
> > 
> > c->inocache_lock
> > 	c->inocache_list
> Protects inodcache list. Also protects objects in it. Protects ic->state.

Ok.

> > c->erase_free_sem
> > 	???
> David hates this. This is to protect node_refs - they are protected by 
> both c->erase_complition lock and by c->erase_free_sem. Most time you use 
> c->erase_completion lock. But if you need sleep, you use mutex.

Sounds like a good candidate for a patch.

Jörn

-- 
Das Aufregende am Schreiben ist es, eine Ordnung zu schaffen, wo
vorher keine existiert hat.
-- Doris Lessing




More information about the linux-mtd mailing list