Question: background GC on UBIFS

Artem Bityutskiy dedekind1 at gmail.com
Thu Mar 31 02:50:15 PDT 2016


On Thu, 2016-03-31 at 10:53 +0200, Richard Weinberger wrote:
> Doing it periodically is doable but how often and when? Only when the
> system
> is completely idle?

I would say - we should give a knob (mechanism) and let the userland
decide when and how much to run it (policy).

> But you can give it a try. Add a new debugfs file to trigger an
> aggressive GC run.

I'd say the trigger should be - GC one eraseblock. Or better, clean
some dirt, or make some free space. Internally this will be GC one
eraseblock, but later on this may change. UBIFS will pick the best
eraseblock to GC automatically. Userland just triggers it at the right
poing. I guess this should be a blocking API - userland blocks until GC
is done. Then it can force more GC.

You can play with this knob, see if it helps.

However, fundamentally, UBIFS will always get slower when the space is
short, by its design. You can make it a bit faster when you have little
space, but you can't make it as fast as when there is more space,
unfortunately. Not easily, at least.

Artem.



More information about the linux-mtd mailing list