diff options
author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-17 21:51:42 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-17 21:51:42 -0500 |
commit | c58310bf4933986513020fa90b4190c7492995ae (patch) | |
tree | 143f2c7578d02ebef5db8fc57ae69e951ae0e2ee /mm/hugetlb.c | |
parent | 269cdfaf769f5cd831284cc831790c7c5038040f (diff) | |
parent | 1309d4e68497184d2fd87e892ddf14076c2bda98 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index db861d8b6c28..cb1b3a7ecdfc 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -24,14 +24,15 @@ | |||
24 | const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; | 24 | const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; |
25 | static unsigned long nr_huge_pages, free_huge_pages, resv_huge_pages; | 25 | static unsigned long nr_huge_pages, free_huge_pages, resv_huge_pages; |
26 | static unsigned long surplus_huge_pages; | 26 | static unsigned long surplus_huge_pages; |
27 | static unsigned long nr_overcommit_huge_pages; | ||
27 | unsigned long max_huge_pages; | 28 | unsigned long max_huge_pages; |
29 | unsigned long sysctl_overcommit_huge_pages; | ||
28 | static struct list_head hugepage_freelists[MAX_NUMNODES]; | 30 | static struct list_head hugepage_freelists[MAX_NUMNODES]; |
29 | static unsigned int nr_huge_pages_node[MAX_NUMNODES]; | 31 | static unsigned int nr_huge_pages_node[MAX_NUMNODES]; |
30 | static unsigned int free_huge_pages_node[MAX_NUMNODES]; | 32 | static unsigned int free_huge_pages_node[MAX_NUMNODES]; |
31 | static unsigned int surplus_huge_pages_node[MAX_NUMNODES]; | 33 | static unsigned int surplus_huge_pages_node[MAX_NUMNODES]; |
32 | static gfp_t htlb_alloc_mask = GFP_HIGHUSER; | 34 | static gfp_t htlb_alloc_mask = GFP_HIGHUSER; |
33 | unsigned long hugepages_treat_as_movable; | 35 | unsigned long hugepages_treat_as_movable; |
34 | unsigned long nr_overcommit_huge_pages; | ||
35 | static int hugetlb_next_nid; | 36 | static int hugetlb_next_nid; |
36 | 37 | ||
37 | /* | 38 | /* |
@@ -605,6 +606,17 @@ int hugetlb_treat_movable_handler(struct ctl_table *table, int write, | |||
605 | return 0; | 606 | return 0; |
606 | } | 607 | } |
607 | 608 | ||
609 | int hugetlb_overcommit_handler(struct ctl_table *table, int write, | ||
610 | struct file *file, void __user *buffer, | ||
611 | size_t *length, loff_t *ppos) | ||
612 | { | ||
613 | proc_doulongvec_minmax(table, write, file, buffer, length, ppos); | ||
614 | spin_lock(&hugetlb_lock); | ||
615 | nr_overcommit_huge_pages = sysctl_overcommit_huge_pages; | ||
616 | spin_unlock(&hugetlb_lock); | ||
617 | return 0; | ||
618 | } | ||
619 | |||
608 | #endif /* CONFIG_SYSCTL */ | 620 | #endif /* CONFIG_SYSCTL */ |
609 | 621 | ||
610 | int hugetlb_report_meminfo(char *buf) | 622 | int hugetlb_report_meminfo(char *buf) |
@@ -813,6 +825,7 @@ static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma, | |||
813 | 825 | ||
814 | spin_unlock(&mm->page_table_lock); | 826 | spin_unlock(&mm->page_table_lock); |
815 | copy_huge_page(new_page, old_page, address, vma); | 827 | copy_huge_page(new_page, old_page, address, vma); |
828 | __SetPageUptodate(new_page); | ||
816 | spin_lock(&mm->page_table_lock); | 829 | spin_lock(&mm->page_table_lock); |
817 | 830 | ||
818 | ptep = huge_pte_offset(mm, address & HPAGE_MASK); | 831 | ptep = huge_pte_offset(mm, address & HPAGE_MASK); |
@@ -858,6 +871,7 @@ retry: | |||
858 | goto out; | 871 | goto out; |
859 | } | 872 | } |
860 | clear_huge_page(page, address); | 873 | clear_huge_page(page, address); |
874 | __SetPageUptodate(page); | ||
861 | 875 | ||
862 | if (vma->vm_flags & VM_SHARED) { | 876 | if (vma->vm_flags & VM_SHARED) { |
863 | int err; | 877 | int err; |