[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100304135128.GA12191@atrey.karlin.mff.cuni.cz>
Date: Thu, 4 Mar 2010 14:51:28 +0100
From: Pavel Machek <pavel@....cz>
To: Catalin Marinas <catalin.marinas@....com>
Cc: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
James.Bottomley@...senPartnership.com, benh@...nel.crashing.org,
linux@....linux.org.uk, mdharm-kernel@...-eyed-alien.net,
linux-usb@...r.kernel.org, x0082077@...com,
sshtylyov@...mvista.com, tom.leiming@...il.com,
bigeasy@...utronix.de, oliver@...kum.org,
linux-kernel@...r.kernel.org, santosh.shilimkar@...com,
greg@...ah.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: USB mass storage and ARM cache coherency
> On Wed, 2010-03-03 at 21:54 +0000, Pavel Machek wrote:
> > > With some drivers (those doing PIO) or subsystems (SCSI mass storage
> > > over USB HCD), there is no call to flush_dcache_page() for page cache
> > > pages, hence the ARM implementation of update_mmu_cache() doesn't flush
> > > the D-cache (and only invalidating the I-cache doesn't help).
> > >
> > > The viable solutions so far:
> > >
> > > 1. Implement a PIO mapping API similar to the DMA API which takes
> > > care of the D-cache flushing. This means that PIO drivers would
> > > need to be modified to use an API like pio_kmap()/pio_kunmap()
> > > before writing to a page cache page.
> > > 2. Invert the meaning of PG_arch_1 to denote a clean page. This
> > > means that by default newly allocated page cache pages are
> > > considered dirty and even if there isn't a call to
> > > flush_dcache_page(), update_mmu_cache() would flush the D-cache.
> > > This is the PowerPC approach.
> >
> > What about option
> >
> > 3. Forget about PG_arch_1 and always do the flush?
> >
> > How big is the performance impact? Note that current code does not
> > even *work* so working, 10% slower code will be an improvement.
>
> The driver fix is as simple as calling a flush_dcache_page() and I've
> been carrying such patches in my tree for some time now. The question is
> whether we need to do it in the driver or not (would need to update
> Documentation/cachetlb.txt as well).
>
> The reason I'm not in favour always doing the flush is that we penalise
> DMA drivers where there is no need for extra D-cache flushing (already
> handled by the DMA API; option 1 above is similar, just that it is meant
> for PIO usage). An ARM patch I proposed for inverting the meaning of
> PG_arch_1 also marks a page as clean in the dma_map_* functions.
But you are not fixing driver bug, are you?
Seems like ARM has requirement other architectures do not, that is
a) not documented anywhere
b) causes problems
You could argue that performance improvement (how big is it, anyway?)
is worth it, but this should be agreed to by wider community...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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