Re: Make 2.5.17 TLB even more friendlier

Paul Mackerras (paulus@samba.org)
Tue, 21 May 2002 22:53:31 +1000 (EST)


David S. Miller writes:

> You get called via pte_free_tlb() and pmd_free_tlb() for every
> operation performed by clear_page_tables(). The PTEs themselves are
> all cleared out at the point that clear_page_tables, so you can't
> possibly need the PTE contents. I am assuming therefore you just
> need to get at the linkage, and those two pte/pmd hooks give you
> that.

I have a bit in the PTE that tells me if there is an MMU hash table
entry for the virtual address represented by the PTE. This bit is not
affected by set_pte or ptep_get_and_clear etc. and it is not part of
the swap-entry fields of the PTE. Thus I need to have the PTE page
still around at the point where I flush stuff from the MMU hash
table, even though all the PTEs in it have been cleared, so that I can
avoid searching the hash table for PTEs for virtual addresses for
which I have not put a PTE in the hash table.

Now I could of course try to come up with some other way to store this
information, such as a bitmap associated with the mmu context. The
bitmap would be 96kB in size for a 3GB userspace, though. It could be
allocated on a page-by-page basis, I guess. But all the schemes I
have thought of so far end up being more complex than using a special
bit in the PTE.

Regards,
Paul.
-
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/