JFFS3 & performance

Jörn Engel joern at wohnheim.fh-wedel.de
Wed Jan 19 10:32:33 EST 2005


On Wed, 19 January 2005 15:27:53 +0000, Artem B. Bityuckiy wrote:
> > 
> > Something like this?
> > 
> > int jffs3_write_with_checksum(void *data, ...)
> > {
> > 	...
> > 	if (mtd->write_with_checksum)
> > 		return mtd->write_with_checksum(data, ...);
> > 	mtd->write(data, ...);
> > 	mtd->write(checksum(data), ...);
> > }
> > 
> > Jörn
> Can't get it - What is the goal? Some advandages?

As you explained, Joakim's proposal doesn't always make sense.
Basically, if the underlying drives uses DMA, there is no point.  If
it does memcpy(), then it's faster to checksum/copy in a single loop,
rather than do both things individually.

With the above code, an mtd driver can supply a converged
checksum/copy method, but doesn't have to.  If it doesn't, we do
regular copy (through mtd->write) and checksum instead.

Jörn

-- 
The wise man seeks everything in himself; the ignorant man tries to get
everything from somebody else.
-- unknown




More information about the linux-mtd mailing list