linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: axboe@kernel.dk (Jens Axboe)
To: linux-arm-kernel@lists.infradead.org
Subject: MMC quirks relating to performance/lifetime.
Date: Tue, 01 Mar 2011 14:15:30 -0500	[thread overview]
Message-ID: <4D6D45D2.2020900@kernel.dk> (raw)
In-Reply-To: <201103012011.51855.arnd@arndb.de>

On 2011-03-01 14:11, Arnd Bergmann wrote:
> On Tuesday 01 March 2011 19:48:17 Jens Axboe wrote:
>>
>> On 2011-02-25 07:21, Arnd Bergmann wrote:
>>> On Friday 25 February 2011, Andrei Warkentin wrote:
>>>> Yup. I understand :-).  That's the strategy I'm going to follow. For
>>>> page_size-alignment/splitting I'm looking at the block layer now. Is
>>>> that the right approach or should I still submit a (cleaned up) patch
>>>> to mmc/card/block.c for that performance improvement.
>>>
>>> I guess it should live in block/cfq-iosched in the long run, but I don't
>>> know how easy it is to implement it there for test purposes.
>>
>> I don't think I saw the original patch(es) for this?
> 
> Nobody has posted one yet, only discussions. Andrei made a patch for the
> MMC block driver to split requests in some cases, but I think the
> concept has changed enough that it's probably not useful to look at
> that patch.
> 
> I think what needs to be done here is to split requests in these cases:
> 
> * Small requests should be split on flash page boundaries, where a page
> is typically 8 to 32 KB. Sending one hardware request that spans two
> partial pages can be slower than sending two requests with the same
> data, but on page boundaries.
> 
> * If a hardware transfer is limited to a few sectors, these should be
> aligned to page boundaries. E.g. assuming a 16 sector page and 32 sector
> maximum transfers, a request that spans from sector 7 to 62 should be
> split into three transfers: 7-15, 16-47 and 48-62, not 7-38 and 39-62.
> This reduces the number of page read-modify-write cycles that the drive
> does.
> 
> * No request should ever span multiple erase blocks. Most flash drives today
> have 4MB erase blocks (sometimes 1, 2 or 8), and the I/O scheduler should
> treat the erase block boundary like a seek on a hard drive. The I/O
> scheduler should try to send all sector writes of an erase block in sequence,
> but after that it can chose any other erase block to write to next.
> 
> I think if we get this logic, we can deal well with all cheap flash drives.
> The two parameters we need are the page size and the erase block size,
> which the kernel can sometimes guess, but should also be tunable in
> sysfs for devices that don't tell us or lie to the kernel about them.
> 
> I'm not sure if we want to do this for all nonrotational media, or
> add another flag to enable these optimizations. On proper SSDs that have
> an intelligent controller and enough RAM, they probably would not help
> all that much, or even make it slightly slower due to a higher number
> of separate write requests.

Thanks for the recap. One way to handle this would be to have a dm
target that ensures that requests are never built up to violate any of
the above items. Doing splitting is a little silly, when you can prevent
it from happening in the first place.

Alternatively, a queue ->merge_bvec_fn() with a settings table could
provide the same.

As this is of limited scope, I would prefer having this done via a
plugin of some sort (like a dm target).

-- 
Jens Axboe

  reply	other threads:[~2011-03-01 19:15 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08 21:22 MMC quirks relating to performance/lifetime Andrei Warkentin
2011-02-08 21:38 ` Wolfram Sang
2011-02-08 22:42 ` Russell King - ARM Linux
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
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 [this message]
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
2011-02-11 14:41 ` Pavel Machek
2011-02-11 14:51   ` Arnd Bergmann
2011-02-11 15:20     ` Lei Wen
2011-02-11 15:25       ` Arnd Bergmann
2011-03-08  6:59     ` Pavel Machek
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=4D6D45D2.2020900@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).