diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2011-01-13 18:46:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:43 -0500 |
commit | b15d00b6af617251cc70a908df983e9aff57e169 (patch) | |
tree | 0fd28ef8d3705505d5b84d495875e3837698b540 /mm/mmap.c | |
parent | ba76149f47d8c939efa0acc07a191237af900471 (diff) |
thp: khugepaged vma merge
register in khugepaged if the vma grows.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/mmu_notifier.h> | 29 | #include <linux/mmu_notifier.h> |
30 | #include <linux/perf_event.h> | 30 | #include <linux/perf_event.h> |
31 | #include <linux/audit.h> | 31 | #include <linux/audit.h> |
32 | #include <linux/khugepaged.h> | ||
32 | 33 | ||
33 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
34 | #include <asm/cacheflush.h> | 35 | #include <asm/cacheflush.h> |
@@ -815,6 +816,7 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm, | |||
815 | end, prev->vm_pgoff, NULL); | 816 | end, prev->vm_pgoff, NULL); |
816 | if (err) | 817 | if (err) |
817 | return NULL; | 818 | return NULL; |
819 | khugepaged_enter_vma_merge(prev); | ||
818 | return prev; | 820 | return prev; |
819 | } | 821 | } |
820 | 822 | ||
@@ -833,6 +835,7 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm, | |||
833 | next->vm_pgoff - pglen, NULL); | 835 | next->vm_pgoff - pglen, NULL); |
834 | if (err) | 836 | if (err) |
835 | return NULL; | 837 | return NULL; |
838 | khugepaged_enter_vma_merge(area); | ||
836 | return area; | 839 | return area; |
837 | } | 840 | } |
838 | 841 | ||
@@ -1761,6 +1764,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) | |||
1761 | } | 1764 | } |
1762 | } | 1765 | } |
1763 | vma_unlock_anon_vma(vma); | 1766 | vma_unlock_anon_vma(vma); |
1767 | khugepaged_enter_vma_merge(vma); | ||
1764 | return error; | 1768 | return error; |
1765 | } | 1769 | } |
1766 | #endif /* CONFIG_STACK_GROWSUP || CONFIG_IA64 */ | 1770 | #endif /* CONFIG_STACK_GROWSUP || CONFIG_IA64 */ |
@@ -1808,6 +1812,7 @@ static int expand_downwards(struct vm_area_struct *vma, | |||
1808 | } | 1812 | } |
1809 | } | 1813 | } |
1810 | vma_unlock_anon_vma(vma); | 1814 | vma_unlock_anon_vma(vma); |
1815 | khugepaged_enter_vma_merge(vma); | ||
1811 | return error; | 1816 | return error; |
1812 | } | 1817 | } |
1813 | 1818 | ||