linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Cache Coherency in PIO Read/Write
@ 2006-08-31 17:02 Fajun Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Fajun Chen @ 2006-08-31 17:02 UTC (permalink / raw)
  To: linux-ide; +Cc: htejun

Hi,

We use sg/libata for data read/write test in ARM XScale platform (VIVT
cache).  We
experienced data miscompare issue during heavy testing on both DMA and
PIO read/write.  In this particular application, data buffer is
allocated inside sg using alloc_pages() and mmapped to user space.
 So essentially this buffer can be accessed by user space, kernel for
PIO and hardware for DMA.  After changing mmapped vma to noncache, we
haven't seen any data miscompare in DMA read/write, but data
miscompare in PIO read/write still exists sporadically.  I suspect
this is caused by kernel cache alias during PIO read/write.  What I
want to know is how the cache coherency is ensured in PIO read/write.
As an alternative, is there any way to make the kernel access to this
data buffer uncached?

Thanks,
Fajun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Cache Coherency in PIO Read/Write
@ 2006-08-31 17:30 Mark Odell
  2006-08-31 18:48 ` Mark Lord
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Odell @ 2006-08-31 17:30 UTC (permalink / raw)
  To: linux-ide

For PIO mode transfers, you should not have cache coherency issues since
the CPU core is doing the read from/write to hardware.

> -----Original Message-----
> From: linux-ide-owner@vger.kernel.org 
> [mailto:linux-ide-owner@vger.kernel.org] On Behalf Of Fajun Chen
> Sent: Thursday, August 31, 2006 1:03 PM
> To: linux-ide@vger.kernel.org
> Cc: htejun@gmail.com
> Subject: Cache Coherency in PIO Read/Write
> 
> Hi,
> 
> We use sg/libata for data read/write test in ARM XScale 
> platform (VIVT cache).  We experienced data miscompare issue 
> during heavy testing on both DMA and PIO read/write.  In this 
> particular application, data buffer is allocated inside sg 
> using alloc_pages() and mmapped to user space.
>  So essentially this buffer can be accessed by user space, 
> kernel for PIO and hardware for DMA.  After changing mmapped 
> vma to noncache, we haven't seen any data miscompare in DMA 
> read/write, but data miscompare in PIO read/write still 
> exists sporadically.  I suspect this is caused by kernel 
> cache alias during PIO read/write.  What I want to know is 
> how the cache coherency is ensured in PIO read/write.
> As an alternative, is there any way to make the kernel access 
> to this data buffer uncached?
> 
> Thanks,
> Fajun
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-ide" in the body of a message to 
> majordomo@vger.kernel.org More majordomo info at  
> http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cache Coherency in PIO Read/Write
  2006-08-31 17:30 Cache Coherency in PIO Read/Write Mark Odell
@ 2006-08-31 18:48 ` Mark Lord
  2006-08-31 19:10   ` Matt Reimer
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Lord @ 2006-08-31 18:48 UTC (permalink / raw)
  To: Mark Odell; +Cc: linux-ide

Mark Odell wrote:
> For PIO mode transfers, you should not have cache coherency issues since
> the CPU core is doing the read from/write to hardware.

One might think so, but cache lines are tagged with virtual addresses,
so using different virtual addresses (kernel vs. userspace) for the 
same data can result in problems like this.

There was a recent thread (this past winter, I believe) devoted to
trying to resolve this issue in 2.6.xx, but I don't remember the final outcome.

Cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cache Coherency in PIO Read/Write
  2006-08-31 18:48 ` Mark Lord
@ 2006-08-31 19:10   ` Matt Reimer
  0 siblings, 0 replies; 4+ messages in thread
From: Matt Reimer @ 2006-08-31 19:10 UTC (permalink / raw)
  To: Mark Lord; +Cc: Mark Odell, linux-ide

On 8/31/06, Mark Lord <liml@rtr.ca> wrote:
> Mark Odell wrote:
> > For PIO mode transfers, you should not have cache coherency issues since
> > the CPU core is doing the read from/write to hardware.
>
> One might think so, but cache lines are tagged with virtual addresses,
> so using different virtual addresses (kernel vs. userspace) for the
> same data can result in problems like this.
>
> There was a recent thread (this past winter, I believe) devoted to
> trying to resolve this issue in 2.6.xx, but I don't remember the final outcome.

http://marc.theaimsgroup.com/?l=linux-arm-kernel&m=107384066503818&w=2
http://marc.theaimsgroup.com/?l=linux-arm-kernel&m=107391014528541&w=2
http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-May/022262.html
http://marc.theaimsgroup.com/?l=linux-ide&m=113517364630085&w=2
http://lkml.org/lkml/2006/1/13/156 and its associated posts

There are probably others. I think Tejun would know best the status of
this issue.

Matt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-08-31 19:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-31 17:30 Cache Coherency in PIO Read/Write Mark Odell
2006-08-31 18:48 ` Mark Lord
2006-08-31 19:10   ` Matt Reimer
  -- strict thread matches above, loose matches on Subject: below --
2006-08-31 17:02 Fajun Chen

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