UBIFS: FileSystem Background Thread

Richard Weinberger richard.weinberger at gmail.com
Fri Jul 1 07:13:24 PDT 2016


On Fri, Jul 1, 2016 at 3:50 PM, 辉少 <wang502742203 at qq.com> wrote:
> Hi,MTD lists
> I've got some questions about ubi file system background thread recently listed below:
> 1. If I mout ubifs again when it's already mounted, will the background thread be created again?

There is one thread per UBIFS instance.

> 2. Is file written to the write-buffer then synchronized to flash media by background thread in both sync mode and async mode?

No, write back is a generic Linux mechanism.

> 3. When I monut ubifs in sync mode and write files to it, it will take several minutes to finish a writting operation at some point as garbage collection, at that point, other threads are blocked by ubifs backgroud thread.But in async mode, that issue never appears. How can background thread block other threads in sync mode? Doesn't context switch happen?

As I wrote in an earlier mail, this should not take minutes. Please
instrument the code to figure
where it spends so much time.
In sync mode the calling thread is blocked, i.e. your write() syscall.

-- 
Thanks,
//richard



More information about the linux-mtd mailing list