From: Marc Lehmann <schmorp@schmorp.de>
To: linux-f2fs-devel@lists.sourceforge.net
Subject: assumptions and misconceptions about f2fs behaviour, please correct
Date: Sun, 4 Oct 2015 11:54:30 +0200 [thread overview]
Message-ID: <20151004095429.GB3177@schmorp.de> (raw)
Hi!
In this mail I describe what I would expect of f2fs in general, and the gc
in particular. I already know my expectations or assumptions are partially
incorrect, and will note so when I know of it. The idea of this mail is
both to correct me in my understanding (if you would be so nice :), and
also explain my expectations and motivation in more detail.
General f2fs behaviour:
Expectation: f2fs logs need not be consecutive, so it can GC sections
relatively independently and, with suitable configuration, it
will always free whole sections (e.g. 128MB at -s64) and reuse
them for writing. This would mitigate the SMR problemxs, because,
assuming continous writing to the fs, it would write whole sections
consecutively, which would span multiple zones.
Reality: quite obviously f2fs reuses space in roughly 2MB chunks, most
likely on a segment basis.
(background) GC:
Expectation/Blind Guessing: While there is nothing to GC, the GC will sleep
for gc_no_gc_sleep_time intervals (it may be woken up for other reasons).
When there is something to GC, then the GC will check if the filesystem
is idle (by unknown means, e.g. by checking if there was activity within
a certain time, or whether there is activity at the moment it checks).
If the fs is idle, it would GC one section (or something similar), then
sleep for gc_min_sleep_time.
If the fs is busy, it would GC one section (or something similar), then
sleep for gc_max_sleep_time.
Ignoring slight variations, the expected behaviour would be for the GC
to GC a bit every gc_min_sleep_time+time_it_takes_for_IO when idle, or
longer when the fs is busy.
As a result, ideal settings would be 0 for gc_min_sleep_time
and something high (potentially very high, such as an hour) for
gc_max_sleep_time.
Reality: If I understood you correctly, the GC will just queue writes
whether there are already outstanding writes or not, it has no notion
of when one GC iteration is finished, so gc_min_sleep_time has to be
long enough for the writes to finish. Since this is impossible (the
time is obviously not fixed and gc_min_sleep_time is a constant), there
is no way to run GC with maximum speed during fs idle times (unless one
writes a separate program to force GC when idle time is detected by
some means).
Also, quite obviously, even when the fs is completely idle, the GC will
typically sleep for gc_max_sleep_time, so it seems "idle fs" is not the
concept that influences the time between gc activity.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / schmorp@schmorp.de
-=====/_/_//_/\_,_/ /_/\_\
------------------------------------------------------------------------------
next reply other threads:[~2015-10-04 9:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-04 9:54 Marc Lehmann [this message]
2015-10-05 22:44 ` assumptions and misconceptions about f2fs behaviour, please correct Jaegeuk Kim
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=20151004095429.GB3177@schmorp.de \
--to=schmorp@schmorp.de \
--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 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).