UBI : Atomic change LEB

Jamie Lokier jamie at shareable.org
Thu Sep 13 10:38:19 EDT 2007


Brijesh Singh wrote:
> Thank you Artem.
> This seems like a good idea.This will certainly work
> .
> The only problem I see is
> * this will serialize  all the automic changes.If some device supports
> multiple writes in parrallel,we are locking it for no reason(We have
> reason but hope we can find another option).Also we won't need
> serialization when there are lots of spare blocks.
> 
> I can't see a better way right now.May be we should think over any
> possible twik to solve it.

Could you use a read-write lock, instead of a mutex?

Lock for "read" (meaning shared) when writing to the MTD device.  Lock
for "write" (meaning exclusive) when erasing.  Then all erases are
serialised, and writes can go in parallel.

Would that solve the locking problems?

If a device can support multiple erases in parallel as well, then
you'd want something more complicated.

-- Jamie



More information about the linux-mtd mailing list