Re: [patch] cache flush bug in mm/filemap.c (all kernels >= 2.5.30(at

Roman Zippel (zippel@linux-m68k.org)
Thu, 29 May 2003 19:49:15 +0200 (CEST)


Hi,

On Wed, 28 May 2003, David S. Miller wrote:

> DMA-mapping.txt defines very precisely when flush_dcache_page() is
> invoked, and that is it's only definition. I purposely DO NOT say
> that "this is for reads" or "this is for handling virtual aliasing
> in L1 caches", I simply define where this macro is invoked and
> that is it.
>
> Specifically, flush_dcache_page() is called any time the kernel makes
> cpu stores into a page cache page that might be mapped into a user's
> address space.

cachetlb.txt also says "_OR_ the kernel is about to read from a page cache
page..." and it's used like this in mm/filemap.c. I think it would be
better to move this into a separate function, e.g. like this:

flush_user_dcache_page(): If the page is mapped writable into user space,
flush the dirty data from the user D-cache, so it becomes visible from the
kernel.
flush_kernel_dcache_page(): The page was written from kernel space and the
data has to become visible in user space, so flush the data into memory
and possibly invalidate data in the user D/I-cache. The flush can be
delayed if this page is currently not mapped.

bye, Roman

-
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/