ubifs:Questions About Garbage Collection
Richard Weinberger
richard.weinberger at gmail.com
Sun Jun 19 07:50:57 PDT 2016
Hi!
On Sun, Jun 19, 2016 at 3:56 PM, 辉少 <wang502742203 at qq.com> wrote:
> Hi,MTD lists
> I meet some problems while using UBI file system recently.I make an experiment in which I write 2 files(1KB each) to UBI frequently.Normally it takes only several millseconds to finish writting 2 files every time,but what puzzles me is that it takes about 4 minutes to write once nearly every 20 to 30 minutes.I am wondering how can this problem happen?Does Garbage Collection lead to this? I mount UBIFS to a 33MiB MTD partion with "o -sync" option.By the way,if UBI is mounted in asynchronous mode, this problem never happens. Does GC(Garbage Collecton) differ in synchronous mode andasynchronous mode? What I've leared from some documents is that GC thread is sleeping while writting files without interval until UBIFS is full in synchronous mode and at that point writing will become very slow, but in asynchronous mode, before data is moved into flash media, GC thread will work when there is not enough free space, am I right?
You observe the issue only in sync mode because every write is done
immediately and therefore the garbage collector needs to
produce empty space. This can take some time and as you are in sync
mode the caller (where you measure the time) will be blocked
until GC produce some space.
In asynchronous mode you will hardly notice since writing do the flash
will be done in a different thread by the write back mechanism.
--
Thanks,
//richard
More information about the linux-mtd
mailing list