All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Martin Steigerwald <Martin@lichtvoll.de>
Cc: linux-kernel@vger.kernel.org, Kim Jaegeuk <jaegeuk.kim@gmail.com>,
	Jaegeuk Kim <jaegeuk.kim@samsung.com>,
	linux-fsdevel@vger.kernel.org, gregkh@linuxfoundation.org,
	viro@zeniv.linux.org.uk, tytso@mit.edu, chur.lee@samsung.com,
	cm224.lee@samsung.com, jooyoung.hwang@samsung.com
Subject: Re: [PATCH 00/16 v3] f2fs: introduce flash-friendly file system
Date: Sat, 10 Nov 2012 21:49:48 +0000	[thread overview]
Message-ID: <201211102149.48946.arnd@arndb.de> (raw)
In-Reply-To: <201211101933.38434.Martin@lichtvoll.de>

On Saturday 10 November 2012, Martin Steigerwald wrote:
> Command (m for help): n
> Partition type:
>    p   primary (0 primary, 0 extended, 4 free)
>    e   extended
> Select (default p): p
> Partition number (1-4, default 1): 1
> First sector (2048-4095998, default 2048): 
> Using default value 2048
> Last sector, +sectors or +size{K,M,G} (2048-4095998, default 4095998): 
> Using default value 4095998

This is almost certainly not the right setting for f2fs, which only works
at its design point if the segments are aligned to erase blocks. All modern
flash devices have erase blocks larger than 1 MB, so starting the partition
at a 1 MB offset will cause it to be misaligned. Also, some USB sticks
have an area optimized for random writes in the beginning of the drive
where both FAT32 and f2fs store their metadata. It may be worth testing
again without a partition table, using just the raw device.

I would also recommend using flashbench to find out the optimum parameters
for your device. You can download it from
git://git.linaro.org/people/arnd/flashbench.git
In the long run, we should automate those tests and make them part of
mkfs.f2fs, but for now, try to find out the erase block size and the number
of concurrently used erase blocks on your device using a timing attack
in flashbench. The README file in there explains how to interpret the
results from "./flashbench -a /dev/sdb  --blocksize=1024" to guess
the erase block size, although that sometimes doesn't work.

With the correct guess, compare the performance you get using

$ ERASESIZE=$[2*1024*1024] # replace with guess from flashbench -a
$ ./flashbench /dev/sdb --open-au --open-au-nr=1 --blocksize=4096 --erasesize=${ERASESIZE}
$ ./flashbench /dev/sdb --open-au --open-au-nr=3 --blocksize=4096 --erasesize=${ERASESIZE}
$ ./flashbench /dev/sdb --open-au --open-au-nr=5 --blocksize=4096 --erasesize=${ERASESIZE}
$ ./flashbench /dev/sdb --open-au --open-au-nr=7 --blocksize=4096 --erasesize=${ERASESIZE}
$ ./flashbench /dev/sdb --open-au --open-au-nr=13 --blocksize=4096 --erasesize=${ERASESIZE}

The first one of those should always be the fastest, hopefully followed by
some that are equally fast and then some much slower ones (especially for the
smaller block sizes). The "active_logs=N" mount option should be one less
than the highest number above that is still "fast", and only "2", "4" and "6"
are valid at the moment. If you are lucky, your device is still fast with
"--open-au-nr=7" and slow only for higher numbers, then the default of "6"
is ok.

If the erase size is larger than 2 MB, then you have to "-s" option in
mkfs.f2fs to configure how many 2 MB segments there are in one erase block.
For a 2 GB USB stick, I would guess that the erase block size is 1, 2 or
4 MB. Newer (larger) sticks will have larger erase blocks that may also
be a multiple of 3 MB (3, 6, 12, or 24).

	Arnd

  parent reply	other threads:[~2012-11-10 21:49 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31  9:35 [PATCH 00/16 v3] f2fs: introduce flash-friendly file system Jaegeuk Kim
2012-10-31  9:38 ` [PATCH 01/17] f2fs: add document Jaegeuk Kim
2012-10-31  9:38   ` Jaegeuk Kim
2012-10-31  9:39 ` [PATCH 02/17] f2fs: add on-disk layout Jaegeuk Kim
2012-10-31  9:41 ` [PATCH 03/17] f2fs: add superblock and major in-memory structure Jaegeuk Kim
2012-10-31  9:58   ` [PATCH 03/17 v2] " Jaegeuk Kim
2012-10-31 22:53     ` [PATCH 03/17 v3] " Jaegeuk Kim
2012-10-31  9:41 ` [PATCH 04/17] f2fs: add super block operations Jaegeuk Kim
2012-10-31  9:43 ` [PATCH 05/17] f2fs: add checkpoint operations Jaegeuk Kim
2012-10-31  9:44 ` [PATCH 06/17] f2fs: add node operations Jaegeuk Kim
2012-10-31  9:44 ` [PATCH 08/17] f2fs: add file operations Jaegeuk Kim
2012-10-31  9:45 ` [PATCH 09/17] f2fs: add address space operations for data Jaegeuk Kim
2012-10-31  9:46 ` [PATCH 10/17] f2fs: add core inode operations Jaegeuk Kim
2012-10-31  9:47 ` [PATCH 11/17] f2fs: add inode operations for special inodes Jaegeuk Kim
2012-10-31  9:47 ` [PATCH 12/17] f2fs: add core directory operations Jaegeuk Kim
2012-10-31  9:48 ` [PATCH 13/17] f2fs: add xattr and acl functionalities Jaegeuk Kim
2012-10-31  9:48 ` [PATCH 14/17] f2fs: add garbage collection functions Jaegeuk Kim
2012-10-31  9:48 ` [PATCH 15/17] f2fs: add recovery routines for roll-forward Jaegeuk Kim
2012-10-31  9:49 ` [PATCH 16/17] f2fs: move proc files to debugfs Jaegeuk Kim
2012-10-31 15:51   ` Greg KH
2012-10-31 21:48     ` Jaegeuk Kim
2012-10-31 22:38       ` [PATCH 16/17 v2] " Jaegeuk Kim
2012-10-31 22:50         ` 'Greg KH'
2012-10-31  9:50 ` [PATCH 17/17] f2fs: update Kconfig and Makefile Jaegeuk Kim
2012-10-31  9:56 ` [PATCH 07/17] f2fs: add segment operations Jaegeuk Kim
2012-11-02 13:39 ` [PATCH 00/16 v3] f2fs: introduce flash-friendly file system Martin Steigerwald
2012-11-02 22:49   ` Kim Jaegeuk
2012-11-10 18:33     ` Martin Steigerwald
2012-11-10 18:33       ` Martin Steigerwald
2012-11-10 18:40       ` Martin Steigerwald
2012-11-10 21:49       ` Arnd Bergmann [this message]
2012-11-12 15:16         ` Martin Steigerwald
2012-11-12 16:57           ` Arnd Bergmann
2012-11-14 15:57             ` Martin Steigerwald
2012-11-16 21:26               ` Arnd Bergmann
2012-11-10 21:55       ` Vyacheslav Dubeyko
2012-11-11 11:42         ` Jaegeuk Kim
2012-11-12  6:04           ` Vyacheslav Dubeyko
2012-11-23  0:23           ` util-linux bug: was " NeilBrown
2012-11-26 13:27             ` Karel Zak
2012-11-26 13:27               ` Karel Zak
2012-11-26 21:06               ` NeilBrown
2012-11-26 21:06                 ` NeilBrown

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=201211102149.48946.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=Martin@lichtvoll.de \
    --cc=chur.lee@samsung.com \
    --cc=cm224.lee@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jaegeuk.kim@gmail.com \
    --cc=jaegeuk.kim@samsung.com \
    --cc=jooyoung.hwang@samsung.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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.