Ralf Baechle wrote:
On Thu, Mar 25, 2004 at 10:42:29PM +0900, Atsushi Nemoto wrote:
I noticed that reading from file with mmap sometimes return wrong data
on 2.4 kernel.
This is a test program to reproduce the problem.
This seems to be the same problem as reported by Peter Horton as while
ago; in his case that was with PIO IDE.
Looks like it.
The fix we're using on Cobalt's at the moment is below (required for
2.4.x and 2.6.x).
Fixing it this way fixes the problem with both page cache pages and swap
For more details see the threads "Kernel 2.4.23 on Cobalt Qube2 - area
of problem" and "Instability / caching problems on Qube 2 - solved ?"
from December last year.
diff -urN linux.cvs/arch/mips/mm/c-r4k.c linux/arch/mips/mm/c-r4k.c
--- linux.cvs/arch/mips/mm/c-r4k.c Mon Jan 12 18:19:51 2004
+++ linux/arch/mips/mm/c-r4k.c Sun Feb 1 13:35:55 2004
@@ -400,8 +400,10 @@
* If there's no context yet, or the page isn't executable, no icache
* flush is needed.
if (!(vma->vm_flags & VM_EXEC))
* Tricky ... Because we don't know the virtual address we've got the
@@ -425,6 +427,11 @@
+ if (!(vma->vm_flags & VM_EXEC))
* We're not sure of the virtual address(es) involved here, so