Re: Problems with kernel mmap (failing tst-mmap-eofsync in glibc onparisc)

From: David S. Miller
Date: Fri Aug 22 2003 - 11:30:54 EST


On 22 Aug 2003 09:40:37 -0500
James Bottomley <James.Bottomley@xxxxxxxxxxxx> wrote:

> This test essentially opens a file (via open(2)), writes something,
> opens it via a mmaped file object *read only* (via fopen(...,"rm)) reads
> what was writtent, writes some more and reads it via the mmaped file
> object.
>
> This last read fails to get the data on parisc. The problem is that our
> CPU cache is virtually indexed, and the page the write is storing the
> data to (in the buffer cache) and the page it is mmapped to have the
> same physical, but different virtual addresses. We need the write() to
> trigger a cache update via flush_dcache_page to get the virtually
> indexed cache in sync.
>
> The reason this doesn't happen is because the mapping is not on the
> mmap_shared list that flush_dcache_page() updates.

flush_dcache_page() checks both the shared and non-shared mmap lists,
so if it is on _either_ list it is flushed. It does not check only
the shared list.

The VM_SHARED change you are proposing is definitely wrong.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/