public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Andrei Warkentin <andreiw@motorola.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-mmc@vger.kernel.org
Subject: Re: MMC quirks relating to performance/lifetime.
Date: Sun, 20 Feb 2011 16:03:41 +0100	[thread overview]
Message-ID: <201102201603.41856.arnd@arndb.de> (raw)
In-Reply-To: <AANLkTi=GO8N15pCnZWuuJ6FfyQMytFt23LPS5oYMNuMu@mail.gmail.com>

On Sunday 20 February 2011 05:39:06 Andrei Warkentin wrote:
> Actually it would be a good idea to also bail/warn if you do the au
> test with more open au's than the size of the passed device allows,
> since it'll just wrap around and skew the results.

Yes, that's a bug. I never noticed because all the devices I tested
have much more space than the test can possibly exercise. I'll
fix it tomorrow.

> > Right, you should try larger values for --open-au-nr here. It's at
> > least a good sign that the drive can do random access inside a segment
> > and that it can have at least 4 segments open. This is much better
> > than I expected from your descriptions at first.
> 
> Actually the Toshiba one seems to have 7 AUs if I interpret this correctly.
> ^C
> # ./flashbench -O -0 6  -b 512 /dev/block/mmcblk0p9
> 4MiB    5.91M/s
> 2MiB    8.84M/s
> 1MiB    10.8M/s
> 512KiB  13M/s
> 256KiB  13.6M/s
> 
> ^C
> # ./flashbench -O -0 7  -b 512 /dev/block/mmcblk0p9
> 4MiB    6.32M/s
> 2MiB    8.63M/s
> 1MiB    10.5M/s
> 512KiB  13.2M/s
> 256KiB  13M/s
> ^[[A^[[D^[[A128KiB  12.3M/s
> ^C
> # ./flashbench -O -0 8  -b 512 /dev/block/mmcblk0p9
> 4MiB    6.65M/s
> 2MiB    7.02M/s
> 1MiB    6.36M/s
> 512KiB  3.17M/s
> 256KiB  1.53M/s

Yes, very good. I've never seen 7, but I've seen all other numbers
betwen 1 and 8 ;-).

> The Sandisk one has 20 AUs.
> 
> # ./flashbench -O -0 20  -b 512 /dev/block/mmcblk0p9
> 4MiB    11.3M/s
> 2MiB    12.8M/s
> 1MiB    9.87M/s
> 512KiB  9.97M/s
> 256KiB  9.13M/s
> 128KiB  8.05M/s
> ^C
> # ./flashbench -O -0 50  -b 512 /dev/block/mmcblk0p9
> 4MiB    7.19M/s
> ^C
> # ./flashbench -O -0 2  -b 512 /dev/block/mmcblk0p9
> ^C
> # ./flashbench -O -0 22  -b 512 /dev/block/mmcblk0p9
> 4MiB    11.6M/s
> 2MiB    12.3M/s
> 1MiB    5.13M/s
> 512KiB  2.57M/s
> 256KiB  1.59M/s
> 128KiB  1.16M/s
> 64KiB   776K/s
> ^C
> # ./flashbench -O -0 21  -b 512 /dev/block/mmcblk0p9
> 4MiB    11.2M/s
> 2MiB    12.4M/s
> 1MiB    4.65M/s
> 512KiB  1.95M/s
> 256KiB  955K/s

20 is a lot, more than any other device I've tested, but that's
good. Sandisk keeps impressing me ;-)

Are you sure you have the allocation unit size correctly for
this device and you don't get into the wrap-around bug
you mention above?

If it indeed uses 4 MB allocation units, flashbench will show
only 10 open segments when run with --erasesize=$[8*1024*1024],
but 20 open segments when run with --erasesize=$[2*1024*1024].

>From your flashbench -a run, I would guess that it uses
8 MB allocation units, although the data is not 100% conclusive
there.

> > However, the drop from 32 KB to 16 KB in performance is horrifying
> > for the Toshiba drive, it's clear that this one does not like
> > to be accessed smaller than 32 KB at a time, an obvious optimization
> > for FAT32 with 32 KB clusters. How does this change with your
> > kernel patches?
> 
> Since the only performance-increasing patch here would be just the one
> that splits unaligned accesses, I wouldn't expect any improvements for
> page-aligned accesses < 32KB. As you can see here...

Ok.

> > For the sandisk drive, it's funny how it is consistently faster
> > doing random access than linear access. I don't think I've seem that
> > before. It does seem to have some cache for linear access using
> > smaller than 16 KB, and can probably combine them when it's only
> > writing to a single segment.
> 
> Yes, that is pretty interesting. Smaller than 16K? Not smaller than
> 32K? I wonder what it is doing...

My interpretation is that it uses 16 KB pages, but can do two page-sized
writes in a single access (multi-plane write). Anything smaller than
a page goes to a temporary buffer first (like the Toshiba chip), but
gets flushed when the next one is not contiguous. If you manage to fill
the entire 16 KB page using small contiguous writes, it can do a single
efficient write access instead.

To confirm that 16 KB is the page size, you can try 

flashbench -s --scatter-span=1 --scatter-order=10 -o plot.data \
	/dev/mmcblk1 -c 32 --blocksize=16384
gnuplot -p -e 'plot "plot.data" '

On most MLC flashes, this will show a pattern alternating between slow
and fast pages like the one from https://lwn.net/Articles/428836/

	Arnd

  reply	other threads:[~2011-02-20 15:03 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTikh4vfS7SLKAa-aUXhbTxcHzYHmBuaXj1qHHYN9@mail.gmail.com>
2011-02-08 21:38 ` MMC quirks relating to performance/lifetime Wolfram Sang
2011-02-09  8:37 ` Linus Walleij
2011-02-09  9:13   ` Arnd Bergmann
2011-02-11 22:33     ` Andrei Warkentin
2011-02-12 17:05       ` Arnd Bergmann
2011-02-12 17:33         ` Andrei Warkentin
2011-02-12 18:22           ` Arnd Bergmann
2011-02-18  1:10       ` Andrei Warkentin
2011-02-18 13:44         ` Arnd Bergmann
2011-02-18 19:47           ` Andrei Warkentin
2011-02-18 22:40             ` Andrei Warkentin
2011-02-18 23:17               ` Andrei Warkentin
2011-02-19 11:20                 ` Arnd Bergmann
2011-02-20  5:56                   ` Andrei Warkentin
2011-02-20 15:23                     ` Arnd Bergmann
2011-02-22  7:05                       ` Andrei Warkentin
2011-02-22 16:49                         ` Arnd Bergmann
2011-02-19  9:54               ` Arnd Bergmann
2011-02-20  4:39                 ` Andrei Warkentin
2011-02-20 15:03                   ` Arnd Bergmann [this message]
2011-02-22  6:42                     ` Andrei Warkentin
2011-02-22 16:42                       ` Arnd Bergmann
2011-02-11 23:23     ` Linus Walleij
2011-02-12 10:45       ` Arnd Bergmann
2011-02-12 10:59         ` Russell King - ARM Linux
2011-02-12 16:28           ` Arnd Bergmann
2011-02-12 16:37             ` Russell King - ARM Linux
2011-02-11 22:27   ` Andrei Warkentin
2011-02-12 18:37     ` Arnd Bergmann
2011-02-13  0:10       ` Andrei Warkentin
2011-02-13 17:39         ` Arnd Bergmann
2011-02-14 19:29           ` Andrei Warkentin
2011-02-14 20:22             ` Arnd Bergmann
2011-02-14 22:25               ` Andrei Warkentin
2011-02-15 17:16                 ` Arnd Bergmann
2011-02-17  2:08                   ` Andrei Warkentin
2011-02-17 15:47                     ` Arnd Bergmann
2011-02-20 11:27                       ` Andrei Warkentin
2011-02-20 14:39                         ` Arnd Bergmann
2011-02-22  7:46                           ` Andrei Warkentin
2011-02-22 17:00                             ` Arnd Bergmann
2011-02-23 10:19                               ` Andrei Warkentin
2011-02-23 16:09                                 ` Arnd Bergmann
2011-02-23 22:26                                   ` Andrei Warkentin
2011-02-24  9:24                                     ` Arnd Bergmann
2011-02-25 11:02                                       ` Andrei Warkentin
2011-02-25 12:21                                         ` Arnd Bergmann
2011-03-01 18:48                                           ` Jens Axboe
2011-03-01 19:11                                             ` Arnd Bergmann
2011-03-01 19:15                                               ` Jens Axboe
2011-03-01 19:51                                                 ` Arnd Bergmann
2011-03-01 21:33                                                   ` Andrei Warkentin
2011-03-02 10:34                                               ` Andrei Warkentin
2011-03-05  9:23                                                 ` Andrei Warkentin
     [not found] ` <201102111551.15508.arnd@arndb.de>
     [not found]   ` <20110308065911.GC1357@ucw.cz>
2011-03-08 14:03     ` Arnd Bergmann

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=201102201603.41856.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=andreiw@motorola.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    /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