That is my understanding too.
> I don't see a reason to worry about privately mapped pages on the i_mmap
> list since they are private, and therefore shouldn't be updated with
> modifications to other mappings,
Actually there is, at least in 2.4. Whenever kernel calls get_user_pages()
it maps a user page into kernel virtual address space. If kernel modifies
that page, flush_dcache_page() needs to make sure any stale cache data
at user virtual address is flush in order user to see kernel changes.
I have a test case at
http://linux.junsun.net/test-programs
(Note, sometimes even if you pass the test, you _may_ still have a wrong
flush_dcache_page() implementation, because stale cache could be flushed
due to other execution sequences)
I took a brief look of 2.5 code. It seems this problem should still
exist (of course, assuming the CPU has cache aliasing problem and the
flush_dcache_page() is not properly implemented).
Actually in 2.5 you may fail the test even if you have a properly implemented
flush_dcache_page(). It appears it lacks another flush_dcache_page()
after the direct_IO is done. I don't have a working 2.5 on MIPS. Can't
verify that.
Jun
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/