linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* UBIFS: FileSystem Background Thread
@ 2016-07-01 13:50 =?gb18030?B?u9TJ2Q==?=
  2016-07-01 14:13 ` Richard Weinberger
  0 siblings, 1 reply; 3+ messages in thread
From: =?gb18030?B?u9TJ2Q==?= @ 2016-07-01 13:50 UTC (permalink / raw)
  To: =?gb18030?B?bGludXgtbXRk?=

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 682 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: UBIFS: FileSystem Background Thread
  2016-07-01 13:50 UBIFS: FileSystem Background Thread =?gb18030?B?u9TJ2Q==?=
@ 2016-07-01 14:13 ` Richard Weinberger
       [not found]   ` <tencent_0A4CA0E45DBD0DC1086D0099@qq.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Weinberger @ 2016-07-01 14:13 UTC (permalink / raw)
  To: 辉少; +Cc: linux-mtd

On Fri, Jul 1, 2016 at 3:50 PM, 辉少 <wang502742203@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 回复: UBIFS: FileSystem Background Thread
       [not found]   ` <tencent_0A4CA0E45DBD0DC1086D0099@qq.com>
@ 2016-07-01 15:03     ` Richard Weinberger
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Weinberger @ 2016-07-01 15:03 UTC (permalink / raw)
  To: 辉少; +Cc: linux-mtd

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 416 bytes --]

Am 01.07.2016 um 16:55 schrieb »ÔÉÙ:
> 1. You mean in async mode file is written to flash by writeback mechanism? If so, background thread has nothing to do with writing file to flash? 

I'd not say nothing, it does the commit.

> 2. In sync mode, is writting finished by ubifs background thread or calling thread calling write()?

The calling thread.

Please start reading the UBIFS source code.

Thanks,
//richard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-01 15:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-01 13:50 UBIFS: FileSystem Background Thread =?gb18030?B?u9TJ2Q==?=
2016-07-01 14:13 ` Richard Weinberger
     [not found]   ` <tencent_0A4CA0E45DBD0DC1086D0099@qq.com>
2016-07-01 15:03     ` 回复: " Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).