[parisc-linux] Bug in flush_dcache_page?

Carlos O'Donell Jr. carlos@baldric.uwo.ca
Wed, 31 Oct 2001 20:56:06 -0500


> 
> Aha.  A couple of things from talking to various VM/VFS people...
> 1. page->mapping is guaranteed to exist for pages in the page cache --
>    this is how they're located.
> 2. If a page is simultaneously mapped in both user and kernel space, and
>    user space touches it, either it leaves the page cache or it was mapped
>    shared.
> 

Why would a user touch cause the page to leave the cache? 
(Maybe I'm not reading enough into it...)

The shared case I can see.

> flush_dcache_page is only called on pages in the page cache, so we can
> assume that page->mapping exists, and we don't need to flush any user
> mappings of this page.
> 
> 	if (!page->mapping->i_mmap & !page->mapping->i_mmap_shared) {
> 		set_bit(PG_dcache_dirty, &page->flags);
> 	} else {
> 		struct vm_area_struct *vma = page->mapping->i_mmap_shared;
> 		if (vma) {
> 			flush_user_page(vma->vm_mm, vma->vm_start + page->index);
> 		}
> 		flush_kernel_dcache_page(page_address(page));
> 	}
> 

Any particular reason for the bitwise and?

c.