aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-17 21:51:42 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-17 21:51:42 -0500
commitc58310bf4933986513020fa90b4190c7492995ae (patch)
tree143f2c7578d02ebef5db8fc57ae69e951ae0e2ee /mm/hugetlb.c
parent269cdfaf769f5cd831284cc831790c7c5038040f (diff)
parent1309d4e68497184d2fd87e892ddf14076c2bda98 (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.c16
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 @@
24const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; 24const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL;
25static unsigned long nr_huge_pages, free_huge_pages, resv_huge_pages; 25static unsigned long nr_huge_pages, free_huge_pages, resv_huge_pages;
26static unsigned long surplus_huge_pages; 26static unsigned long surplus_huge_pages;
27static unsigned long nr_overcommit_huge_pages;
27unsigned long max_huge_pages; 28unsigned long max_huge_pages;
29unsigned long sysctl_overcommit_huge_pages;
28static struct list_head hugepage_freelists[MAX_NUMNODES]; 30static struct list_head hugepage_freelists[MAX_NUMNODES];
29static unsigned int nr_huge_pages_node[MAX_NUMNODES]; 31static unsigned int nr_huge_pages_node[MAX_NUMNODES];
30static unsigned int free_huge_pages_node[MAX_NUMNODES]; 32static unsigned int free_huge_pages_node[MAX_NUMNODES];
31static unsigned int surplus_huge_pages_node[MAX_NUMNODES]; 33static unsigned int surplus_huge_pages_node[MAX_NUMNODES];
32static gfp_t htlb_alloc_mask = GFP_HIGHUSER; 34static gfp_t htlb_alloc_mask = GFP_HIGHUSER;
33unsigned long hugepages_treat_as_movable; 35unsigned long hugepages_treat_as_movable;
34unsigned long nr_overcommit_huge_pages;
35static int hugetlb_next_nid; 36static 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
609int 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
610int hugetlb_report_meminfo(char *buf) 622int 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;