All of lore.kernel.org
 help / color / mirror / Atom feed
* File IO write flush time span
@ 2020-02-25  5:58 JH
  2020-02-25  8:31 ` Richard Weinberger
  0 siblings, 1 reply; 4+ messages in thread
From: JH @ 2020-02-25  5:58 UTC (permalink / raw)
  To: linux-mtd

Hi,

If I write a file to a UBIFS volume, how long the mtd will write it
from cache to physical NAND? I try to understand in what time span
those IO writing in cache will be lost if the power is turned off
(lost power).

Thank you.

Kind regards,

- jh

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: File IO write flush time span
  2020-02-25  5:58 File IO write flush time span JH
@ 2020-02-25  8:31 ` Richard Weinberger
  2020-02-25  8:45   ` JH
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Weinberger @ 2020-02-25  8:31 UTC (permalink / raw)
  To: JH; +Cc: linux-mtd

On Tue, Feb 25, 2020 at 6:58 AM JH <jupiter.hce@gmail.com> wrote:
>
> Hi,
>
> If I write a file to a UBIFS volume, how long the mtd will write it
> from cache to physical NAND? I try to understand in what time span
> those IO writing in cache will be lost if the power is turned off
> (lost power).

What cache do you have in mind?
As soon ubiupdatevol terminates, the volume is in stable state.

-- 
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: File IO write flush time span
  2020-02-25  8:31 ` Richard Weinberger
@ 2020-02-25  8:45   ` JH
  2020-02-25  8:54     ` Richard Weinberger
  0 siblings, 1 reply; 4+ messages in thread
From: JH @ 2020-02-25  8:45 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-mtd

Hi Richard,

On 2/25/20, Richard Weinberger <richard.weinberger@gmail.com> wrote:
> On Tue, Feb 25, 2020 at 6:58 AM JH <jupiter.hce@gmail.com> wrote:
>>
>> Hi,
>>
>> If I write a file to a UBIFS volume, how long the mtd will write it
>> from cache to physical NAND? I try to understand in what time span
>> those IO writing in cache will be lost if the power is turned off
>> (lost power).
>
> What cache do you have in mind?
> As soon ubiupdatevol terminates, the volume is in stable state.

I was actually talking about applications write files to a UBIFS
volume mounted as RW in Linux, let's say if I write a file by vi, will
it immediately flush to the NAND or will it stay in cache until some
algorithm in MTD to erase NAND pages and flush the cache to NAND page
based on size of output or time, is it correct?

Thank you.

Kind regards,

- jh

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: File IO write flush time span
  2020-02-25  8:45   ` JH
@ 2020-02-25  8:54     ` Richard Weinberger
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Weinberger @ 2020-02-25  8:54 UTC (permalink / raw)
  To: JH; +Cc: linux-mtd

On Tue, Feb 25, 2020 at 9:45 AM JH <jupiter.hce@gmail.com> wrote:
> I was actually talking about applications write files to a UBIFS
> volume mounted as RW in Linux, let's say if I write a file by vi, will
> it immediately flush to the NAND or will it stay in cache until some
> algorithm in MTD to erase NAND pages and flush the cache to NAND page
> based on size of output or time, is it correct?

UBIFS is a filesystem and follows the rules of the vfs and pagecache.
But it is less forgiving than ext3/4. To make sure data hits the NAND you
need to properly use fsync/fdatasync().

-- 
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2020-02-25  8:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25  5:58 File IO write flush time span JH
2020-02-25  8:31 ` Richard Weinberger
2020-02-25  8:45   ` JH
2020-02-25  8:54     ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.