From: Artem Bityutskiy <dedekind1@gmail.com>
To: Stefani Seibold <stefani@seibold.net>
Cc: nico@fluxnic.net, michael.kreuzer@nsn.com,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
akpm@linux-foundation.org, dwmw2@infradead.org
Subject: Re: [PATCH] Fix a huge latency problem in the MTD CFI and LPDDR flash drivers.
Date: Fri, 23 Apr 2010 15:03:24 +0300 [thread overview]
Message-ID: <1272024204.6917.9.camel@localhost> (raw)
In-Reply-To: <1271623604.7050.0.camel@wall-e.seibold.net>
On Sun, 2010-04-18 at 22:46 +0200, Stefani Seibold wrote:
> From: Stefani Seibold <stefani@seibold.net>
>
> The use of a memcpy() during a spinlock operation will cause very long
> thread context switch delays if the flash chip bandwidth is low and the
> data to be copied large, because a spinlock will disable preemption.
>
> For example: A flash with 6,5 MB/s bandwidth will cause under ubifs,
> which request sometimes 128 KB (the flash erase size), a preemption delay of
> 20 milliseconds. High priority threads will not be served during this
> time, regardless whether this threads access the flash or not. This behavior
> breaks real time.
>
> The patch changes all the use of spin_lock operations for xxxx->mutex
> into mutex operations, which is exact what the name says and means.
>
> I have checked the code of the drivers and there is no use of atomic
> pathes like interrupt or timers. The mtdoops facility will also not be used
> by this drivers. So it is dave to replace the spin_lock against mutex.
>
> There is no performance regression since the mutex is normally not
> acquired.
>
> Changelog:
> 06.03.2010 First release
> 26.03.2010 Fix mutex[1] issue and tested it for compile failure
>
> Signed-off-by: Stefani Seibold <stefani@seibold.net>
> ---
> drivers/mtd/chips/cfi_cmdset_0001.c | 131 +++++++++++++++++-----------------
> drivers/mtd/chips/cfi_cmdset_0002.c | 122 ++++++++++++++++----------------
> drivers/mtd/chips/cfi_cmdset_0020.c | 136 +++++++++++++++++-----------------
> drivers/mtd/chips/fwh_lock.h | 6 +-
> drivers/mtd/chips/gen_probe.c | 3 +-
> drivers/mtd/lpddr/lpddr_cmds.c | 79 ++++++++++----------
> include/linux/mtd/flashchip.h | 4 +-
> 7 files changed, 239 insertions(+), 242 deletions(-)
Pushed to l2-mtd-2.6.git / master.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
WARNING: multiple messages have this Message-ID (diff)
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Stefani Seibold <stefani@seibold.net>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, dwmw2@infradead.org,
michael.kreuzer@nsn.com, nico@fluxnic.net
Subject: Re: [PATCH] Fix a huge latency problem in the MTD CFI and LPDDR flash drivers.
Date: Fri, 23 Apr 2010 15:03:24 +0300 [thread overview]
Message-ID: <1272024204.6917.9.camel@localhost> (raw)
In-Reply-To: <1271623604.7050.0.camel@wall-e.seibold.net>
On Sun, 2010-04-18 at 22:46 +0200, Stefani Seibold wrote:
> From: Stefani Seibold <stefani@seibold.net>
>
> The use of a memcpy() during a spinlock operation will cause very long
> thread context switch delays if the flash chip bandwidth is low and the
> data to be copied large, because a spinlock will disable preemption.
>
> For example: A flash with 6,5 MB/s bandwidth will cause under ubifs,
> which request sometimes 128 KB (the flash erase size), a preemption delay of
> 20 milliseconds. High priority threads will not be served during this
> time, regardless whether this threads access the flash or not. This behavior
> breaks real time.
>
> The patch changes all the use of spin_lock operations for xxxx->mutex
> into mutex operations, which is exact what the name says and means.
>
> I have checked the code of the drivers and there is no use of atomic
> pathes like interrupt or timers. The mtdoops facility will also not be used
> by this drivers. So it is dave to replace the spin_lock against mutex.
>
> There is no performance regression since the mutex is normally not
> acquired.
>
> Changelog:
> 06.03.2010 First release
> 26.03.2010 Fix mutex[1] issue and tested it for compile failure
>
> Signed-off-by: Stefani Seibold <stefani@seibold.net>
> ---
> drivers/mtd/chips/cfi_cmdset_0001.c | 131 +++++++++++++++++-----------------
> drivers/mtd/chips/cfi_cmdset_0002.c | 122 ++++++++++++++++----------------
> drivers/mtd/chips/cfi_cmdset_0020.c | 136 +++++++++++++++++-----------------
> drivers/mtd/chips/fwh_lock.h | 6 +-
> drivers/mtd/chips/gen_probe.c | 3 +-
> drivers/mtd/lpddr/lpddr_cmds.c | 79 ++++++++++----------
> include/linux/mtd/flashchip.h | 4 +-
> 7 files changed, 239 insertions(+), 242 deletions(-)
Pushed to l2-mtd-2.6.git / master.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
next prev parent reply other threads:[~2010-04-23 12:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-18 20:46 [PATCH] Fix a huge latency problem in the MTD CFI and LPDDR flash drivers Stefani Seibold
2010-04-20 18:16 ` Stefani Seibold
2010-04-20 18:16 ` Stefani Seibold
2010-04-23 6:03 ` Stefani Seibold
2010-04-23 6:03 ` Stefani Seibold
2010-04-23 3:07 ` Andrew Morton
2010-04-23 3:07 ` Andrew Morton
2010-04-28 13:58 ` Artem Bityutskiy
2010-04-28 13:58 ` Artem Bityutskiy
2010-04-23 12:03 ` Artem Bityutskiy [this message]
2010-04-23 12:03 ` Artem Bityutskiy
-- strict thread matches above, loose matches on Subject: below --
2010-03-26 10:36 stefani
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=1272024204.6917.9.camel@localhost \
--to=dedekind1@gmail.com \
--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=nico@fluxnic.net \
--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.