On Thu, 2011-01-06 at 12:25 -0600, James Bottomley wrote:> OK, so thinking about this, it seems that the only danger is actually> what NFS is doing: reading cache pages via a vmap. In that case, since> the requirement is to invalidate the vmap range to prepare for read, we> could have invalidate_kernel_vmap_range loop over the underlying pages> and flush them through the kernel alias if the architecture specific> flag indicates their contents might be dirty.> > The loop adds expense that is probably largely unnecessary to> invalidate_kernel_vmap_range() but the alternative is adding to the API> proliferation with something that only flushes the kernel pages if the> arch specific flag says they're dirty.

This is what I think the arm patch would look like (example only: Ican't compile it). Is something like this too expensive? the loop can'tbe optimised away because of the need to check the pages (andvmalloc_to_page is a three level page table lookup).