From: Paolo Minazzi <Paolo.Minazzi@mitrol.it>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: f2fs, mount -o sync, sync and cut-off power
Date: Fri, 31 Oct 2014 10:17:02 +0100 [thread overview]
Message-ID: <5453538E.3090505@mitrol.it> (raw)
In-Reply-To: <20141031062221.GA13251@jaegeuk-mac02.hsd1.ca.comcast.net>
Il 31/10/2014 07:22, Jaegeuk Kim ha scritto:
> Hi Paolo,
>
> You can use -o sync,fastboot for the case.
> Please refer the patch that I sent.
>
> [PATCH 4/4] f2fs: introduce -o fastboot for reducing booting time only
>
> If a system wants to reduce the booting time as a top priority, now we can
> use a mount option, -o fastboot.
> With this option, f2fs conducts a little bit slow write_checkpoint, but
> it can avoid the node page reads during the next mount time.
>
> Note that, from the performance viewpoint, it would be enough to use -o sync,
> which has no stability problem since it calls fsync.
Hi Kim, thanks for for answer.
To be precise I use a kernel 3.0.35.
I have found a backport of f2fsby arter 97. The backport should be new
enough.
You have written:
Note that, from the performance viewpoint, it would be enough to use -o sync,
which has no stability problem since it calls fsync.
On this I see different behaviour.
I see that "-o sync" does not call fsync.
I have studied small tests with my version (3.0.35 with a f2fs backport)
and mounting with "-o sync"
===== TEST1=====
touch /mnt/file
cut-off the power
In this case the file is not written. The recovery does not find
/mnt/file. The checkpoint is not created.
===== TEST2 =====
echo > /mnt/file
cut-off the power
In this case the file is written, and the recovery sees the /mnt/file.
The checkpoint is not created.
The data are written by the flush f2fs kernel_thread.
In both test TEST1 and TEST2 the checkpoint is not created. I added a
printk in the function write_checkpoint to
see when it is executed. I added also a printk in the flush f2fs
kernel_thread.
I understand that I do not use the latest version, so it is difficult
for you help me.
I cannot port all the new f2fs in my code.I'm afraid to insert bugs.
So I have tried a simple solution, but I'm not sure if it is correct.
I create a simple kernel_thread
int sync_kernel_thread(void *)
{
while(1)
{
f2fs_freeze(sb);
wait_completion(&comp);
}
}
Every operation that write, create file, create directory ..... and so
on .... activate the thread using
complete(&comp);
So my filesystem is always synced. The boot is fast.
I do not think I will introduce race conditions ... What do you think
about ?
Thanks again,
Paolo
------------------------------------------------------------------------------
prev parent reply other threads:[~2014-10-31 9:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 7:35 f2fs, mount -o sync, sync and cut-off power Paolo Minazzi
2014-10-30 23:11 ` Changman Lee
2014-10-31 6:22 ` Jaegeuk Kim
2014-10-31 9:17 ` Paolo Minazzi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5453538E.3090505@mitrol.it \
--to=paolo.minazzi@mitrol.it \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.