Re: can't flush tlb on e500

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Benjamin Herrenschmidt
Date: Friday, May 22, 2009 - 2:20 am

On Fri, 2009-05-22 at 09:57 +0900, Hideo Saito wrote:

Not in this version of the CPU but in others... so we need to be a bit
more careful.

It's true that the current code will mark one context as stale but will
end up flushing them all from the TLB. This does have the
disadvantage that subsequent context switch might want to proceed to
more stealing with flush despite the fact that the TLB is indeed empty.

Your approach seems a bit hackish in the implementation but makes
somewhat sense in effectively disconnecting all context numbers when the
TLB is flushed. It's however not necessarily useable as-is on SMP.

One thing I would try to do in the future for example is to have a
lockless scenario when a context is already assigned. Your approach
would cause, under pressure, contexts to be de-assigned a bit to
aggressively. There are other reasons also why I wouldn't be so eager to
recycle PIDs.

Maybe a better option is to keep separate maps, between assigned
contexts and "dirty" contexts. IE. The current map means assigned. A
context that is switch_mm'ed is marked dirty. We could maybe use that to
make smarter decisions as to when re-assign a PID and when use one that
we know has been flushed out and not re-dirty'ed yet.

Also, it would also make some sense to have flush_tlb_mm() clear the
dirty map in that case as well. In fact, there's a patch coming from
Dave Kleikamp that implements lazy flushing by effectively just
recycling PIDs for flush_tlb_mm() and only do a flush when running out.

Cheers,
Ben.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
can't flush tlb on e500, Saito Hideo, (Wed May 20, 3:12 am)
Re: can't flush tlb on e500, Hideo Saito, (Thu May 21, 5:57 pm)
Re: can't flush tlb on e500, Benjamin Herrenschmidt, (Fri May 22, 2:20 am)
Re: can't flush tlb on e500, Benjamin Herrenschmidt, (Fri May 22, 2:27 am)
Re: can't flush tlb on e500, Benjamin Herrenschmidt, (Fri May 22, 2:42 am)