diff options
author | Hugh Dickins <hugh@veritas.com> | 2005-04-19 16:29:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org.(none)> | 2005-04-19 16:29:15 -0400 |
commit | ee39b37b23da0b6ec53a8ebe90ff41c016f8ae27 (patch) | |
tree | 4af606913ab8f95551623b788c0c66c1f5902229 /mm/mmap.c | |
parent | e0da382c92626ad1d7f4b7527d19b80104d67a83 (diff) |
[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 <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1900,6 +1900,7 @@ void exit_mmap(struct mm_struct *mm) | |||
1900 | struct mmu_gather *tlb; | 1900 | struct mmu_gather *tlb; |
1901 | struct vm_area_struct *vma = mm->mmap; | 1901 | struct vm_area_struct *vma = mm->mmap; |
1902 | unsigned long nr_accounted = 0; | 1902 | unsigned long nr_accounted = 0; |
1903 | unsigned long end; | ||
1903 | 1904 | ||
1904 | lru_add_drain(); | 1905 | lru_add_drain(); |
1905 | 1906 | ||
@@ -1908,10 +1909,10 @@ void exit_mmap(struct mm_struct *mm) | |||
1908 | flush_cache_mm(mm); | 1909 | flush_cache_mm(mm); |
1909 | tlb = tlb_gather_mmu(mm, 1); | 1910 | tlb = tlb_gather_mmu(mm, 1); |
1910 | /* Use -1 here to ensure all VMAs in the mm are unmapped */ | 1911 | /* Use -1 here to ensure all VMAs in the mm are unmapped */ |
1911 | mm->map_count -= unmap_vmas(&tlb, mm, vma, 0, -1, &nr_accounted, NULL); | 1912 | end = unmap_vmas(&tlb, mm, vma, 0, -1, &nr_accounted, NULL); |
1912 | vm_unacct_memory(nr_accounted); | 1913 | vm_unacct_memory(nr_accounted); |
1913 | free_pgtables(&tlb, vma, 0, 0); | 1914 | free_pgtables(&tlb, vma, 0, 0); |
1914 | tlb_finish_mmu(tlb, 0, MM_VM_SIZE(mm)); | 1915 | tlb_finish_mmu(tlb, 0, end); |
1915 | 1916 | ||
1916 | mm->mmap = mm->mmap_cache = NULL; | 1917 | mm->mmap = mm->mmap_cache = NULL; |
1917 | mm->mm_rb = RB_ROOT; | 1918 | mm->mm_rb = RB_ROOT; |
@@ -1931,7 +1932,6 @@ void exit_mmap(struct mm_struct *mm) | |||
1931 | vma = next; | 1932 | vma = next; |
1932 | } | 1933 | } |
1933 | 1934 | ||
1934 | BUG_ON(mm->map_count); /* This is just debugging */ | ||
1935 | BUG_ON(mm->nr_ptes); /* This is just debugging */ | 1935 | BUG_ON(mm->nr_ptes); /* This is just debugging */ |
1936 | } | 1936 | } |
1937 | 1937 | ||