lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 12 Mar 2010 23:38:20 +0000
From:	Jamie Lokier <jamie@...reable.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Stefani Seibold <stefani@...bold.net>,
	David Woodhouse <dwmw2@...radead.org>,
	"Kreuzer, Michael (NSN - DE/Ulm)" <michael.kreuzer@....com>,
	linux-mtd@...ts.infradead.org,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [Patch] fix MTD CFI/LPDDR flash driver huge latency bug

Andrew Morton wrote:
> On Sat, 06 Mar 2010 17:48:57 +0100
> Stefani Seibold <stefani@...bold.net> wrote:
> 
> > This patch fix a huge latency problem in the MTD CFI and LPDDR flash
> > drivers.
> > 
> > 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.

I agree that's a problem, and it's not just real time that's affected.

I've just realised I have a video player with ~1.5 MB/s bandwidth
64kb/block flash attached, and this might be the reason JFFS2 activity
makes video play less smooth on it.  44ms is even worse.

> > 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.

> > There is no performance regression since the mutex is normally not
> > acquired.
> 
> hm, big scary patch.  Are you sure this mutex is never taken from
> atomic or irq contexts?  Is it ully tested with all relevant debug options
> and lockdep enabled?

Including from mtdoops?

-- Jamie
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ