UBI : Atomic change LEB

Artem Bityutskiy dedekind at infradead.org
Thu Sep 13 09:16:28 EDT 2007

On Thu, 2007-09-13 at 18:32 +0530, 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.

Well, this is not a big problem with the existing code base: mtd anyway
locks whole chip when doing I/O, and there are not users of this call
except of UBIFS which will not suffer much.

Also, if this is a problem for someone, we can always reserve N PEBs
for the atomic LEB change operation, and allow N tasks to do this
operation at a time. This is not difficult, we just need to use
something a bit more complex then a mutex.

Best regards,
Artem Bityutskiy (Битюцкий Артём)

More information about the linux-mtd mailing list