Re: [PATCH] flush_cache_page while pte valid

Manfred Spraul
2002-11-11T21:13:52Z

> /* Nuke the page table entry. */
>+ flush_cache_page(vma, address);
> pte = ptep_get_and_clear(ptep);
> flush_tlb_page(vma, address);
>- flush_cache_page(vma, address);
>

Is it correct that this are 3 arch hooks that must appear back to back?
What about one hook with all parameters?

pte = ptep_get_and_clear_and_flush(ptep, vma, address);

The current implementation just asks for such errors.

Documentation:
ptep_get_and_clear_and_flush() removes the page table entry *ptep from the page tables and clears all caches (tlb, cpu cache if virtually tagged).
The return value contains the final value of the pte. The critical information is the dirty bit in the pte - on SMP one cpu can call ptep_get_and_clear_and_flush() while another cpu accesses the mmap'ing from user space.

--
Manfred