Re: 回复:ubifs:Questions About Garbage Collection
Richard Weinberger
richard at nod.at
Sun Jun 19 10:05:14 PDT 2016
Am 19.06.2016 um 18:14 schrieb 辉少:
> Thanks for your kind reply!Do you mean that in synchronous/asynchronous mode GC is also finished in synchronous
> /asynchronous way as writting is? A more question is,are all dirty spaces collected in the same time in synchronous mode(at this point the caller will be blocked for a long time) while in asynchronous mode dirty spaces will be collected little by little in asynchronous mode when i do not notice?Thank you!
Hmm, I don't fully understand your first question, can you elaborate?
As for dirty space, GC will not collect all dirty space. UBIFS tells GC how much free space an operation
will take. UBIFS calls this budget. The GC will try to produce as much free space as needed.
Thanks,
//richard
> ---原始邮件---
> *发件人:* "Richard Weinberger"<richard.weinberger at gmail.com>
> *发送时间:* 2016年6月19日 22:51:43
> *收件人:* "辉少"<wang502742203 at qq.com>;
> *抄送:* "linux-mtd"<linux-mtd at lists.infradead.org>;
> *主题:* Re: ubifs:Questions About Garbage Collection
>
> 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
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
More information about the linux-mtd
mailing list