Re: Make 2.5.17 TLB even more friendlier

Linus Torvalds (torvalds@transmeta.com)
Tue, 21 May 2002 16:13:37 -0700 (PDT)


On Wed, 22 May 2002, Paul Mackerras wrote:
> I'm thinking now that I would be better off doing the batching by
> storing a list of virtual addresses needing flushing in the
> mmu_gather_t, instead of relying on getting at the special bits in the
> PTEs at some time after the tlb_remove_tlb_entry call.

Well, you can combine that with something like

static inline void tlb_remove_tlb_entry(tlb, pte, address)
{
if (pte_tlb_hash(pte)) {
if (tlb->start_addr == NOSTART)
tlb->start_addr = address;
tlb->end_addr = address+PAGE_SIZE;
}
}

and then have the tlb_end_vma() do something like

/* No pages mapped? */
if (tlb->start_addr == NOADDR)
return;
pte_remove_range(vma, tlb->start_addr, tlb->end_addr)
tlb->start_addr = NOADDR;

which will bunch them up on a vma granularity (if there is any reason to
do that), while still retaining the optimization that if a VMA was mostly
unmapped you wouldn't need to do a lot of hash table searching because of
the start/end thing.

Linus

-
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/