public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Stefani Seibold <stefani@seibold.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Kreuzer, Michael (NSN - DE/Ulm)" <michael.kreuzer@nsn.com>,
	linux-mtd@lists.infradead.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [Patch] fix MTD CFI/LPDDR flash driver huge latency bug
Date: Fri, 19 Mar 2010 08:40:48 +0000	[thread overview]
Message-ID: <20100319084048.GA1670@shareable.org> (raw)
In-Reply-To: <1268987355.4028.33.camel@macbook.infradead.org>

David Woodhouse wrote:
> Rather than pulling a number our of our posterior like "every 256 bytes"
> which might _really_ screw up performance of some architectures' memcpy
> routines, I suspect we might want the platform to provide an optimised
> "sleepable_memcpy" function which does it at whatever interval is
> appropriate for the memcpy routine in use. Or magically makes it
> preemptable. Or uses a DMA engine. Or whatever.
>
> I wonder where else we could use such a function...

The posterior number isn't great, although I don't see how it would
really harm memcpy performance to check current->need_resched even
quite often.

In this instance, the speed depends on the flash which can be as much
as 100x slower than RAM - that's the particular situation where it
might be most useful to split the copies.

Other uses of sleepable_memcpy you may be thinking of could be
operating on RAM only, so the number should be 100x larger for them.

In other words, "whatever interval is appropriate for memcpy" does not
exist, and could not be hard-coded into sleepable_memcpy.  It's
whatever interval is appropriate for the particular memory being
copied, so it would have to be a parameter.

-- Jamie

  reply	other threads:[~2010-03-19  8:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-06 16:48 [Patch] fix MTD CFI/LPDDR flash driver huge latency bug Stefani Seibold
2010-03-12 22:23 ` Andrew Morton
2010-03-12 23:38   ` Jamie Lokier
2010-03-13 12:35     ` Stefani Seibold
2010-03-15  3:03       ` Jamie Lokier
2010-03-15  6:15         ` Stefani Seibold
2010-03-15 14:24           ` Jamie Lokier
2010-03-19  8:29             ` David Woodhouse
2010-03-19  8:40               ` Jamie Lokier [this message]
2010-03-13 12:31   ` Stefani Seibold
2010-03-13 11:25     ` Andrew Morton
2010-03-13 17:00       ` Stefani Seibold
  -- strict thread matches above, loose matches on Subject: below --
2010-02-28 17:00 Stefani Seibold

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=20100319084048.GA1670@shareable.org \
    --to=jamie@shareable.org \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael.kreuzer@nsn.com \
    --cc=stefani@seibold.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