linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* assumptions and misconceptions about f2fs behaviour, please correct
@ 2015-10-04  9:54 Marc Lehmann
  2015-10-05 22:44 ` Jaegeuk Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Lehmann @ 2015-10-04  9:54 UTC (permalink / raw)
  To: linux-f2fs-devel

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
      -=====/_/_//_/\_,_/ /_/\_\

------------------------------------------------------------------------------

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

end of thread, other threads:[~2015-10-05 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-04  9:54 assumptions and misconceptions about f2fs behaviour, please correct Marc Lehmann
2015-10-05 22:44 ` Jaegeuk Kim

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).