* flushing cache after block io
@ 2007-05-01 13:58 Bahadir Balban
2007-05-01 17:46 ` Mark Lord
0 siblings, 1 reply; 5+ messages in thread
From: Bahadir Balban @ 2007-05-01 13:58 UTC (permalink / raw)
To: linux-ide
Hi,
On an ARM core with write-allocate writeback cache, there can be cache
inconsistencies when an executable file is read from a block device
into memory.
On a compact flash block device driver, I got around this problem by
flushing the caches for the pages that bio buffers use on every bio
read. E.g.
cflash_read_sectors(dev, sect_begin, nsect, buf);
flush_icache_range(buf, buf + nsect*512);
Now I have the same problem with a ATA harddisk connected with a
PDC20269 controller. The question is where would be the best
high-level place to put these flushes so that it works regardless of
what block IO driver is used?
Thanks,
Bahadir
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: flushing cache after block io
2007-05-01 13:58 flushing cache after block io Bahadir Balban
@ 2007-05-01 17:46 ` Mark Lord
2007-05-03 13:23 ` Russell King
2007-05-03 13:25 ` Bahadir Balban
0 siblings, 2 replies; 5+ messages in thread
From: Mark Lord @ 2007-05-01 17:46 UTC (permalink / raw)
To: Bahadir Balban, Russell King; +Cc: linux-ide
Bahadir Balban wrote:
> On an ARM core with write-allocate writeback cache, there can be cache
> inconsistencies when an executable file is read from a block device
> into memory.
>
> On a compact flash block device driver, I got around this problem by
> flushing the caches for the pages that bio buffers use on every bio
> read. E.g.
>
> cflash_read_sectors(dev, sect_begin, nsect, buf);
> flush_icache_range(buf, buf + nsect*512);
>
> Now I have the same problem with a ATA harddisk connected with a
> PDC20269 controller. The question is where would be the best
> high-level place to put these flushes so that it works regardless of
> what block IO driver is used?
Russell, didn't you go through all of this pain and fix it
a year or two ago?
Bahadir, exactly what kernel/version is this with?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: flushing cache after block io
2007-05-01 17:46 ` Mark Lord
@ 2007-05-03 13:23 ` Russell King
2007-05-03 13:25 ` Bahadir Balban
1 sibling, 0 replies; 5+ messages in thread
From: Russell King @ 2007-05-03 13:23 UTC (permalink / raw)
To: Mark Lord; +Cc: Bahadir Balban, linux-ide
On Tue, May 01, 2007 at 01:46:56PM -0400, Mark Lord wrote:
>
> Bahadir Balban wrote:
> >On an ARM core with write-allocate writeback cache, there can be cache
> >inconsistencies when an executable file is read from a block device
> >into memory.
> >
> >On a compact flash block device driver, I got around this problem by
> >flushing the caches for the pages that bio buffers use on every bio
> >read. E.g.
> >
> >cflash_read_sectors(dev, sect_begin, nsect, buf);
> >flush_icache_range(buf, buf + nsect*512);
> >
> >Now I have the same problem with a ATA harddisk connected with a
> >PDC20269 controller. The question is where would be the best
> >high-level place to put these flushes so that it works regardless of
> >what block IO driver is used?
>
> Russell, didn't you go through all of this pain and fix it
> a year or two ago?
I thought so.
> Bahadir, exactly what kernel/version is this with?
Bahadir must be using an old kernel.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: flushing cache after block io
2007-05-01 17:46 ` Mark Lord
2007-05-03 13:23 ` Russell King
@ 2007-05-03 13:25 ` Bahadir Balban
2007-05-03 13:30 ` Russell King
1 sibling, 1 reply; 5+ messages in thread
From: Bahadir Balban @ 2007-05-03 13:25 UTC (permalink / raw)
To: Mark Lord; +Cc: Russell King, linux-ide
On 5/1/07, Mark Lord <liml@rtr.ca> wrote:
>
> Russell, didn't you go through all of this pain and fix it
> a year or two ago?
>
> Bahadir, exactly what kernel/version is this with?
>
>
This is on 2.6.19 but I'm unsure if there's a fix in the tree as I
might be one of the few to try ARM MPCore with a block device.
Although, filesystems over mtd or nfs work fine without the flushing.
If you have an idea please let me know.
Thanks,
Bahadir
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: flushing cache after block io
2007-05-03 13:25 ` Bahadir Balban
@ 2007-05-03 13:30 ` Russell King
0 siblings, 0 replies; 5+ messages in thread
From: Russell King @ 2007-05-03 13:30 UTC (permalink / raw)
To: Bahadir Balban; +Cc: Mark Lord, linux-ide
On Thu, May 03, 2007 at 02:25:44PM +0100, Bahadir Balban wrote:
> On 5/1/07, Mark Lord <liml@rtr.ca> wrote:
> >
> >Russell, didn't you go through all of this pain and fix it
> >a year or two ago?
> >
> >Bahadir, exactly what kernel/version is this with?
> >
> >
>
> This is on 2.6.19 but I'm unsure if there's a fix in the tree as I
> might be one of the few to try ARM MPCore with a block device.
> Although, filesystems over mtd or nfs work fine without the flushing.
You want to be running something post 2.6.20-rc5 ideally (so 2.6.20).
There's a couple of cache flushing related patches merged between .19
and .20.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-05-03 13:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-01 13:58 flushing cache after block io Bahadir Balban
2007-05-01 17:46 ` Mark Lord
2007-05-03 13:23 ` Russell King
2007-05-03 13:25 ` Bahadir Balban
2007-05-03 13:30 ` Russell King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).