diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 17 | ||||
-rw-r--r-- | mm/mremap.c | 7 | ||||
-rw-r--r-- | mm/nommu.c | 3 | ||||
-rw-r--r-- | mm/rmap.c | 2 | ||||
-rw-r--r-- | mm/swapfile.c | 2 |
5 files changed, 22 insertions, 9 deletions
diff --git a/mm/memory.c b/mm/memory.c index 6bad4c4064e7..d209f745db7f 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1701,12 +1701,13 @@ static int do_swap_page(struct mm_struct * mm, | |||
1701 | spin_lock(&mm->page_table_lock); | 1701 | spin_lock(&mm->page_table_lock); |
1702 | page_table = pte_offset_map(pmd, address); | 1702 | page_table = pte_offset_map(pmd, address); |
1703 | if (unlikely(!pte_same(*page_table, orig_pte))) { | 1703 | if (unlikely(!pte_same(*page_table, orig_pte))) { |
1704 | pte_unmap(page_table); | ||
1705 | spin_unlock(&mm->page_table_lock); | ||
1706 | unlock_page(page); | ||
1707 | page_cache_release(page); | ||
1708 | ret = VM_FAULT_MINOR; | 1704 | ret = VM_FAULT_MINOR; |
1709 | goto out; | 1705 | goto out_nomap; |
1706 | } | ||
1707 | |||
1708 | if (unlikely(!PageUptodate(page))) { | ||
1709 | ret = VM_FAULT_SIGBUS; | ||
1710 | goto out_nomap; | ||
1710 | } | 1711 | } |
1711 | 1712 | ||
1712 | /* The page isn't present yet, go ahead with the fault. */ | 1713 | /* The page isn't present yet, go ahead with the fault. */ |
@@ -1741,6 +1742,12 @@ static int do_swap_page(struct mm_struct * mm, | |||
1741 | spin_unlock(&mm->page_table_lock); | 1742 | spin_unlock(&mm->page_table_lock); |
1742 | out: | 1743 | out: |
1743 | return ret; | 1744 | return ret; |
1745 | out_nomap: | ||
1746 | pte_unmap(page_table); | ||
1747 | spin_unlock(&mm->page_table_lock); | ||
1748 | unlock_page(page); | ||
1749 | page_cache_release(page); | ||
1750 | goto out; | ||
1744 | } | 1751 | } |
1745 | 1752 | ||
1746 | /* | 1753 | /* |
diff --git a/mm/mremap.c b/mm/mremap.c index 0dd7ace94e51..ec7238a78f36 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
@@ -224,6 +224,12 @@ static unsigned long move_vma(struct vm_area_struct *vma, | |||
224 | split = 1; | 224 | split = 1; |
225 | } | 225 | } |
226 | 226 | ||
227 | /* | ||
228 | * if we failed to move page tables we still do total_vm increment | ||
229 | * since do_munmap() will decrement it by old_len == new_len | ||
230 | */ | ||
231 | mm->total_vm += new_len >> PAGE_SHIFT; | ||
232 | |||
227 | if (do_munmap(mm, old_addr, old_len) < 0) { | 233 | if (do_munmap(mm, old_addr, old_len) < 0) { |
228 | /* OOM: unable to split vma, just get accounts right */ | 234 | /* OOM: unable to split vma, just get accounts right */ |
229 | vm_unacct_memory(excess >> PAGE_SHIFT); | 235 | vm_unacct_memory(excess >> PAGE_SHIFT); |
@@ -237,7 +243,6 @@ static unsigned long move_vma(struct vm_area_struct *vma, | |||
237 | vma->vm_next->vm_flags |= VM_ACCOUNT; | 243 | vma->vm_next->vm_flags |= VM_ACCOUNT; |
238 | } | 244 | } |
239 | 245 | ||
240 | mm->total_vm += new_len >> PAGE_SHIFT; | ||
241 | __vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT); | 246 | __vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT); |
242 | if (vm_flags & VM_LOCKED) { | 247 | if (vm_flags & VM_LOCKED) { |
243 | mm->locked_vm += new_len >> PAGE_SHIFT; | 248 | mm->locked_vm += new_len >> PAGE_SHIFT; |
diff --git a/mm/nommu.c b/mm/nommu.c index b293ec1cc4e6..c53e9c8f6b4a 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -150,7 +150,8 @@ void vfree(void *addr) | |||
150 | kfree(addr); | 150 | kfree(addr); |
151 | } | 151 | } |
152 | 152 | ||
153 | void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot) | 153 | void *__vmalloc(unsigned long size, unsigned int __nocast gfp_mask, |
154 | pgprot_t prot) | ||
154 | { | 155 | { |
155 | /* | 156 | /* |
156 | * kmalloc doesn't like __GFP_HIGHMEM for some reason | 157 | * kmalloc doesn't like __GFP_HIGHMEM for some reason |
@@ -586,7 +586,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma) | |||
586 | dec_mm_counter(mm, anon_rss); | 586 | dec_mm_counter(mm, anon_rss); |
587 | } | 587 | } |
588 | 588 | ||
589 | inc_mm_counter(mm, rss); | 589 | dec_mm_counter(mm, rss); |
590 | page_remove_rmap(page); | 590 | page_remove_rmap(page); |
591 | page_cache_release(page); | 591 | page_cache_release(page); |
592 | 592 | ||
diff --git a/mm/swapfile.c b/mm/swapfile.c index a60e0075d55b..da48405cd9a3 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -79,7 +79,7 @@ void swap_unplug_io_fn(struct backing_dev_info *unused_bdi, struct page *page) | |||
79 | WARN_ON(page_count(page) <= 1); | 79 | WARN_ON(page_count(page) <= 1); |
80 | 80 | ||
81 | bdi = bdev->bd_inode->i_mapping->backing_dev_info; | 81 | bdi = bdev->bd_inode->i_mapping->backing_dev_info; |
82 | bdi->unplug_io_fn(bdi, page); | 82 | blk_run_backing_dev(bdi, page); |
83 | } | 83 | } |
84 | up_read(&swap_unplug_sem); | 84 | up_read(&swap_unplug_sem); |
85 | } | 85 | } |