Re: tlb_gather_mmu() and semantics of "fullmm"

David Miller
2009-03-26T19:37:33Z

From: Hugh Dickins <hugh@veritas.com>
Date: Thu, 26 Mar 2009 14:08:17 +0000 (GMT)

> On Thu, 26 Mar 2009, Benjamin Herrenschmidt wrote:
> > If it means the later (which it does in practice today, since we only
> > call it from exit_mmap(), unless I missed an important detail), then I
> > could implement some optimisations in my own arch code, but more
>
> Yes, I'm pretty sure you can assume the latter. The whole point
> of the "full mm" stuff (would have better been named "exit mm") is
> to allow optimizations, and I don't see what optimization there is to
> be made from knowing you're going the whole length of the mm; whereas
> optimizations can be made if you know nothing can happen in parallel.
>
> Cc'ed DaveM who introduced it for sparc64, and Zach and Jeremy
> who have delved there, in case they wish to disagree.

The TLBs on sparc64 have a "context flush" which removes every entry
matching the current MMU context. This is what flush_tlb_mm() does.

So we use tlb->fullmm so that the individual page and range TLB
flushes do nothing, and instead we do a flush_tlb_mm() before we walk
through the address space to tear it down.