[Linux-ia64] Re: switch_mm race condition with Ingo's scheduler

From: Erich Focht <efocht_at_ess.nec.de>
Date: 2002-07-13 03:26:07
> But the only time you might reuse an old context number is when you
> allocate one.  Yes, you will have old entries hanging around in the
> TLB for a while, but you _know_ that the corresponding tasks already
> died and you also know that you'll flush the TLB before re-using one
> of those context numbers.

Context numbers are global, used by all CPUs in common. Suppose
task 123 is newly created and we want a context number for it. Unfortunately
it's time to wrap around context numbers and we reuse the context number
of task 100 which died a short while ago and left over TLB entries on all
CPUs of the machine.

get_new_mmu_context is called on the CPU where task 123 is scheduled first.
We can flush TLB there. But on the other CPUs the stale entries of task 100
survive. If no new context is needed before task 123 gets migrated to
another CPU, it might reuse TLB entries of task 100, which are wrong.
I'm not worried about taking an old context number but of using old TLB
entries when my newly created task with reused context number switches
CPUs. flush_tlb_all() was flushing all TLB entries by sending an IPI but
this can lead to a deadlock... Do I misunderstand something?

Received on Fri Jul 12 10:26:14 2002

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:09 EST