From ee39b37b23da0b6ec53a8ebe90ff41c016f8ae27 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Tue, 19 Apr 2005 13:29:15 -0700 Subject: [PATCH] freepgt: remove MM_VM_SIZE(mm) There's only one usage of MM_VM_SIZE(mm) left, and it's a troublesome macro because mm doesn't contain the (32-bit emulation?) info needed. But it too is only needed because we ignore the end from the vma list. We could make flush_pgtables return that end, or unmap_vmas. Choose the latter, since it's a natural fit with unmap_mapping_range_vma needing to know its restart addr. This does make more than minimal change, but if unmap_vmas had returned the end before, this is how we'd have done it, rather than storing the break_addr in zap_details. unmap_vmas used to return count of vmas scanned, but that's just debug which hasn't been useful in a while; and if we want the map_count 0 on exit check back, it can easily come from the final remove_vm_struct loop. Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/mmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mm/mmap.c') diff --git a/mm/mmap.c b/mm/mmap.c index 926d0301547..f8c61b2385f 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1900,6 +1900,7 @@ void exit_mmap(struct mm_struct *mm) struct mmu_gather *tlb; struct vm_area_struct *vma = mm->mmap; unsigned long nr_accounted = 0; + unsigned long end; lru_add_drain(); @@ -1908,10 +1909,10 @@ void exit_mmap(struct mm_struct *mm) flush_cache_mm(mm); tlb = tlb_gather_mmu(mm, 1); /* Use -1 here to ensure all VMAs in the mm are unmapped */ - mm->map_count -= unmap_vmas(&tlb, mm, vma, 0, -1, &nr_accounted, NULL); + end = unmap_vmas(&tlb, mm, vma, 0, -1, &nr_accounted, NULL); vm_unacct_memory(nr_accounted); free_pgtables(&tlb, vma, 0, 0); - tlb_finish_mmu(tlb, 0, MM_VM_SIZE(mm)); + tlb_finish_mmu(tlb, 0, end); mm->mmap = mm->mmap_cache = NULL; mm->mm_rb = RB_ROOT; @@ -1931,7 +1932,6 @@ void exit_mmap(struct mm_struct *mm) vma = next; } - BUG_ON(mm->map_count); /* This is just debugging */ BUG_ON(mm->nr_ptes); /* This is just debugging */ } -- cgit v1.2.3-18-g5258