Question about free_pgd_slow ?

rocky bill_carson at 126.com
Sat Mar 5 05:19:27 EST 2011


At 2011-03-02 23:52:03,"Rabin Vincent" <rabin at rab.in> wrote:>On Fri, Feb 25, 2011 at 09:05, rocky <bill_carson at 126.com> wrote:>> free_pgd_slow in arch/arm/mm/pgd.c  free the 4 pages at pgd level,l>> while could I ask a question about why free the page by pointed by pgd>> index 0 ?>>Besides the 16k for the pgd, it frees the second level* page table>referenced at index 0 of the pgd.>>(* - of course it frees pud+pmd+pte, but on current ARM this folds down>to just the second level page table.)>>On ARM, FIRST_USER_ADDRESS is set to PAGE_SIZE because the vectors may>need to be placed at 0x0.  Since the tables for that translation have to>always be active, functions like exit_mmap() will not free the 0th>secondary level page table (see the calls to free_pgtables() there).  So>we free it here when we're freeing the pgd.
Thanks Rabin
I dig the code more deeper,
exit_mmap called free_pgtables by setting floor with FIRST_USER_ADDRESS, 
then in free_pgd_range , vma->start first aligned with PMD_MASK before compared with floor, 
PMD_MASK for arm is 2M aligned ,so that means 0~0x200000 virtual address mapping is free in
free_pgd_slow.

But I still dont get it, 
why is that  low vector mapping must always be active even though the task is going to exit?

rocky



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110305/374de67a/attachment-0001.html>


More information about the linux-arm-kernel mailing list