I am looking at the piece of code in do_wp_page that reads:
copy_cow_page(old_page,new_page);
flush_page_to_ram(old_page);
flush_page_to_ram(new_page);
flush_cache_page(vma, address);
set_pte(page_table, pte_mkwrite(pte_mkdirty(mk_pte(new_page, vma->vm_page_prot))));
free_page(old_page);
flush_tlb_page(vma, address);
I can see that the flush_cache_page() is needed for a processor that
has virtually indexed, virtually tagged L1, but is there any such
processor that Linux supports (sparc?)? Does this processor also
need virtual alias avoidance support from the os because the processor
can not detect such aliasing?
For MIPS R4000PC, with a virtually indexed physically tagged L1, I
think it might be enough to just have a flush_page_to_ram(new_page);
to avoid aliasing issues ...
In any case, I can't see a reason for flush_page_to_ram(old_page);
Can anyone tell me why that might be needed (on whichever processor)?
Another place that I can't explain why a flush_cache_page might be
needed is in:
case 1:
/* We can release the kernel lock now.. */
unlock_kernel();
flush_cache_page(vma, address);
set_pte(page_table, pte_mkdirty(pte_mkwrite(pte)));
flush_tlb_page(vma, address);
end_wp_page:
if (new_page)
free_page(new_page);
return 1;
Thanks.
Kanoj
kanoj@engr.sgi.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/