All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Stefani Seibold <stefani@seibold.net>
Cc: linux-mtd@lists.infradead.org,
	Andrew Morton <akpm@linux-foundation.org>,
	David Woodhouse <dwmw2@infradead.org>,
	"Kreuzer, Michael \(NSN - DE/Ulm\)" <michael.kreuzer@nsn.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [Patch] fix MTD CFI/LPDDR flash driver huge latency bug
Date: Mon, 15 Mar 2010 14:24:21 +0000	[thread overview]
Message-ID: <20100315142421.GB15133@shareable.org> (raw)
In-Reply-To: <1268633754.6012.4.camel@wall-e.seibold.net>

Stefani Seibold wrote:
> Am Montag, den 15.03.2010, 03:03 +0000 schrieb Jamie Lokier:
> > Stefani Seibold wrote:
> > > Am Freitag, den 12.03.2010, 23:38 +0000 schrieb Jamie Lokier:
> > > > Andrew Morton wrote:
> > > > > On Sat, 06 Mar 2010 17:48:57 +0100
> > > > > Stefani Seibold <stefani@seibold.net> wrote:
> > > > > 
> > > 
> > > 
> > > > > > The patch change all the use of spin_lock operations for xxxx->mutex
> > > > > > into mutex operations, which is exact what the name says and means.
> > > > 
> > > > It would be even better if it also split the critical sections into
> > > > smaller ones with cond_resched() between, so that non-preemptible
> > > > kernels benefit too.
> > > 
> > > The problem is the memcpy operation which is very slow. A cond_resched
> > > wouldn't help, since the cpu bus is blocked during the transfer of the
> > > word.
> > 
> > I mean split the memcpy into multiple smaller memcpys, so that the
> > total time in each memcpy is limited to something reasonable.
> > 
> > The check in cond_resched() is fast, especially once cached.  memcpy
> > speed depends a lot on the attached flash and how everything's
> > configured, varying from 2.5MB/s up to hundreds of MB/s.  So how about
> > doing cond_resched() every 256 bytes?
> > 
> > -- Jamie
> 
> I thoght about this aporoach and i don't like this idea. Why not using a
> preemptible kernel?

Because it introduces too many risks to enable CONFIG_PREEMPT in a
stable rolled out device which isn't using it already.  Especially on
devices where it's not well tested by other people, and with drivers
that nobody ever used with CONFIG_PREEMPT before.

And because CONFIG_PREEMPT isn't always better.  (Why do you think
it's a config option?)

As a bug fix for observed high scheduling latency when a flash I/O is
occurring, splitting the memcpys is a good choice.  I will be trying
it on my kernels, even if it doesn't get mainlined.  Thanks for the idea ;-)

-- Jamie

WARNING: multiple messages have this Message-ID (diff)
From: Jamie Lokier <jamie@shareable.org>
To: Stefani Seibold <stefani@seibold.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Woodhouse <dwmw2@infradead.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: Mon, 15 Mar 2010 14:24:21 +0000	[thread overview]
Message-ID: <20100315142421.GB15133@shareable.org> (raw)
In-Reply-To: <1268633754.6012.4.camel@wall-e.seibold.net>

Stefani Seibold wrote:
> Am Montag, den 15.03.2010, 03:03 +0000 schrieb Jamie Lokier:
> > Stefani Seibold wrote:
> > > Am Freitag, den 12.03.2010, 23:38 +0000 schrieb Jamie Lokier:
> > > > Andrew Morton wrote:
> > > > > On Sat, 06 Mar 2010 17:48:57 +0100
> > > > > Stefani Seibold <stefani@seibold.net> wrote:
> > > > > 
> > > 
> > > 
> > > > > > The patch change all the use of spin_lock operations for xxxx->mutex
> > > > > > into mutex operations, which is exact what the name says and means.
> > > > 
> > > > It would be even better if it also split the critical sections into
> > > > smaller ones with cond_resched() between, so that non-preemptible
> > > > kernels benefit too.
> > > 
> > > The problem is the memcpy operation which is very slow. A cond_resched
> > > wouldn't help, since the cpu bus is blocked during the transfer of the
> > > word.
> > 
> > I mean split the memcpy into multiple smaller memcpys, so that the
> > total time in each memcpy is limited to something reasonable.
> > 
> > The check in cond_resched() is fast, especially once cached.  memcpy
> > speed depends a lot on the attached flash and how everything's
> > configured, varying from 2.5MB/s up to hundreds of MB/s.  So how about
> > doing cond_resched() every 256 bytes?
> > 
> > -- Jamie
> 
> I thoght about this aporoach and i don't like this idea. Why not using a
> preemptible kernel?

Because it introduces too many risks to enable CONFIG_PREEMPT in a
stable rolled out device which isn't using it already.  Especially on
devices where it's not well tested by other people, and with drivers
that nobody ever used with CONFIG_PREEMPT before.

And because CONFIG_PREEMPT isn't always better.  (Why do you think
it's a config option?)

As a bug fix for observed high scheduling latency when a flash I/O is
occurring, splitting the memcpys is a good choice.  I will be trying
it on my kernels, even if it doesn't get mainlined.  Thanks for the idea ;-)

-- Jamie


  reply	other threads:[~2010-03-15 14:24 UTC|newest]

Thread overview: 26+ 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-06 16:48 ` Stefani Seibold
2010-03-12 22:23 ` Andrew Morton
2010-03-12 22:23   ` Andrew Morton
2010-03-12 23:38   ` Jamie Lokier
2010-03-12 23:38     ` Jamie Lokier
2010-03-13 12:35     ` Stefani Seibold
2010-03-13 12:35       ` Stefani Seibold
2010-03-15  3:03       ` Jamie Lokier
2010-03-15  3:03         ` Jamie Lokier
2010-03-15  6:15         ` Stefani Seibold
2010-03-15  6:15           ` Stefani Seibold
2010-03-15 14:24           ` Jamie Lokier [this message]
2010-03-15 14:24             ` Jamie Lokier
2010-03-19  8:29             ` David Woodhouse
2010-03-19  8:29               ` David Woodhouse
2010-03-19  8:40               ` Jamie Lokier
2010-03-19  8:40                 ` Jamie Lokier
2010-03-13 12:31   ` Stefani Seibold
2010-03-13 12:31     ` Stefani Seibold
2010-03-13 11:25     ` Andrew Morton
2010-03-13 11:25       ` Andrew Morton
2010-03-13 17:00       ` Stefani Seibold
2010-03-13 17:00         ` Stefani Seibold
  -- strict thread matches above, loose matches on Subject: below --
2010-02-28 17:00 Stefani Seibold
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=20100315142421.GB15133@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 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.