Question about free_pgd_slow ?
Rabin Vincent
rabin at rab.in
Mon Mar 7 09:44:58 EST 2011
2011/3/5 rocky <bill_carson at 126.com>:
> But I still dont get it, why is that low vector mapping must always
> be active even though the task is going to exit?
exit_mmap() is called by the exiting task. In this case, the page table
that free_pgtables() operates on is the page table which is currently
in use. Consider what would happen if we remove the vector mapping here
and an interrupt hits immediately after -- the cpu will (recursively)
fault while trying to find the vector page mapping.
pgd_free() on the other hand is safe because it's called when we've
switched away from this mm, and the page table is no longer in use
(mm->mm_count == 0).
Have a look at exit_mm(), which increases the mm_count before calling
mm_put(), and finish_task_switch(), which does the mmdrop().
More information about the linux-arm-kernel
mailing list