diff options
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index b336690be9f6..c65a8a583d13 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -127,7 +127,7 @@ static inline struct hugepage_subpool *subpool_inode(struct inode *inode) | |||
127 | 127 | ||
128 | static inline struct hugepage_subpool *subpool_vma(struct vm_area_struct *vma) | 128 | static inline struct hugepage_subpool *subpool_vma(struct vm_area_struct *vma) |
129 | { | 129 | { |
130 | return subpool_inode(vma->vm_file->f_dentry->d_inode); | 130 | return subpool_inode(file_inode(vma->vm_file)); |
131 | } | 131 | } |
132 | 132 | ||
133 | /* | 133 | /* |
@@ -1293,8 +1293,7 @@ static void __init report_hugepages(void) | |||
1293 | 1293 | ||
1294 | for_each_hstate(h) { | 1294 | for_each_hstate(h) { |
1295 | char buf[32]; | 1295 | char buf[32]; |
1296 | printk(KERN_INFO "HugeTLB registered %s page size, " | 1296 | pr_info("HugeTLB registered %s page size, pre-allocated %ld pages\n", |
1297 | "pre-allocated %ld pages\n", | ||
1298 | memfmt(buf, huge_page_size(h)), | 1297 | memfmt(buf, huge_page_size(h)), |
1299 | h->free_huge_pages); | 1298 | h->free_huge_pages); |
1300 | } | 1299 | } |
@@ -1702,8 +1701,7 @@ static void __init hugetlb_sysfs_init(void) | |||
1702 | err = hugetlb_sysfs_add_hstate(h, hugepages_kobj, | 1701 | err = hugetlb_sysfs_add_hstate(h, hugepages_kobj, |
1703 | hstate_kobjs, &hstate_attr_group); | 1702 | hstate_kobjs, &hstate_attr_group); |
1704 | if (err) | 1703 | if (err) |
1705 | printk(KERN_ERR "Hugetlb: Unable to add hstate %s", | 1704 | pr_err("Hugetlb: Unable to add hstate %s", h->name); |
1706 | h->name); | ||
1707 | } | 1705 | } |
1708 | } | 1706 | } |
1709 | 1707 | ||
@@ -1826,9 +1824,8 @@ static void hugetlb_register_node(struct node *node) | |||
1826 | nhs->hstate_kobjs, | 1824 | nhs->hstate_kobjs, |
1827 | &per_node_hstate_attr_group); | 1825 | &per_node_hstate_attr_group); |
1828 | if (err) { | 1826 | if (err) { |
1829 | printk(KERN_ERR "Hugetlb: Unable to add hstate %s" | 1827 | pr_err("Hugetlb: Unable to add hstate %s for node %d\n", |
1830 | " for node %d\n", | 1828 | h->name, node->dev.id); |
1831 | h->name, node->dev.id); | ||
1832 | hugetlb_unregister_node(node); | 1829 | hugetlb_unregister_node(node); |
1833 | break; | 1830 | break; |
1834 | } | 1831 | } |
@@ -1924,7 +1921,7 @@ void __init hugetlb_add_hstate(unsigned order) | |||
1924 | unsigned long i; | 1921 | unsigned long i; |
1925 | 1922 | ||
1926 | if (size_to_hstate(PAGE_SIZE << order)) { | 1923 | if (size_to_hstate(PAGE_SIZE << order)) { |
1927 | printk(KERN_WARNING "hugepagesz= specified twice, ignoring\n"); | 1924 | pr_warning("hugepagesz= specified twice, ignoring\n"); |
1928 | return; | 1925 | return; |
1929 | } | 1926 | } |
1930 | BUG_ON(hugetlb_max_hstate >= HUGE_MAX_HSTATE); | 1927 | BUG_ON(hugetlb_max_hstate >= HUGE_MAX_HSTATE); |
@@ -1960,8 +1957,8 @@ static int __init hugetlb_nrpages_setup(char *s) | |||
1960 | mhp = &parsed_hstate->max_huge_pages; | 1957 | mhp = &parsed_hstate->max_huge_pages; |
1961 | 1958 | ||
1962 | if (mhp == last_mhp) { | 1959 | if (mhp == last_mhp) { |
1963 | printk(KERN_WARNING "hugepages= specified twice without " | 1960 | pr_warning("hugepages= specified twice without " |
1964 | "interleaving hugepagesz=, ignoring\n"); | 1961 | "interleaving hugepagesz=, ignoring\n"); |
1965 | return 1; | 1962 | return 1; |
1966 | } | 1963 | } |
1967 | 1964 | ||
@@ -2482,7 +2479,7 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma, | |||
2482 | address = address & huge_page_mask(h); | 2479 | address = address & huge_page_mask(h); |
2483 | pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + | 2480 | pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + |
2484 | vma->vm_pgoff; | 2481 | vma->vm_pgoff; |
2485 | mapping = vma->vm_file->f_dentry->d_inode->i_mapping; | 2482 | mapping = file_inode(vma->vm_file)->i_mapping; |
2486 | 2483 | ||
2487 | /* | 2484 | /* |
2488 | * Take the mapping lock for the duration of the table walk. As | 2485 | * Take the mapping lock for the duration of the table walk. As |
@@ -2692,9 +2689,8 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
2692 | * COW. Warn that such a situation has occurred as it may not be obvious | 2689 | * COW. Warn that such a situation has occurred as it may not be obvious |
2693 | */ | 2690 | */ |
2694 | if (is_vma_resv_set(vma, HPAGE_RESV_UNMAPPED)) { | 2691 | if (is_vma_resv_set(vma, HPAGE_RESV_UNMAPPED)) { |
2695 | printk(KERN_WARNING | 2692 | pr_warning("PID %d killed due to inadequate hugepage pool\n", |
2696 | "PID %d killed due to inadequate hugepage pool\n", | 2693 | current->pid); |
2697 | current->pid); | ||
2698 | return ret; | 2694 | return ret; |
2699 | } | 2695 | } |
2700 | 2696 | ||
@@ -2924,14 +2920,14 @@ follow_huge_pud(struct mm_struct *mm, unsigned long address, | |||
2924 | return NULL; | 2920 | return NULL; |
2925 | } | 2921 | } |
2926 | 2922 | ||
2927 | int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, | 2923 | long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, |
2928 | struct page **pages, struct vm_area_struct **vmas, | 2924 | struct page **pages, struct vm_area_struct **vmas, |
2929 | unsigned long *position, int *length, int i, | 2925 | unsigned long *position, unsigned long *nr_pages, |
2930 | unsigned int flags) | 2926 | long i, unsigned int flags) |
2931 | { | 2927 | { |
2932 | unsigned long pfn_offset; | 2928 | unsigned long pfn_offset; |
2933 | unsigned long vaddr = *position; | 2929 | unsigned long vaddr = *position; |
2934 | int remainder = *length; | 2930 | unsigned long remainder = *nr_pages; |
2935 | struct hstate *h = hstate_vma(vma); | 2931 | struct hstate *h = hstate_vma(vma); |
2936 | 2932 | ||
2937 | spin_lock(&mm->page_table_lock); | 2933 | spin_lock(&mm->page_table_lock); |
@@ -3001,7 +2997,7 @@ same_page: | |||
3001 | } | 2997 | } |
3002 | } | 2998 | } |
3003 | spin_unlock(&mm->page_table_lock); | 2999 | spin_unlock(&mm->page_table_lock); |
3004 | *length = remainder; | 3000 | *nr_pages = remainder; |
3005 | *position = vaddr; | 3001 | *position = vaddr; |
3006 | 3002 | ||
3007 | return i ? i : -EFAULT; | 3003 | return i ? i : -EFAULT; |
@@ -3033,6 +3029,7 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma, | |||
3033 | if (!huge_pte_none(huge_ptep_get(ptep))) { | 3029 | if (!huge_pte_none(huge_ptep_get(ptep))) { |
3034 | pte = huge_ptep_get_and_clear(mm, address, ptep); | 3030 | pte = huge_ptep_get_and_clear(mm, address, ptep); |
3035 | pte = pte_mkhuge(pte_modify(pte, newprot)); | 3031 | pte = pte_mkhuge(pte_modify(pte, newprot)); |
3032 | pte = arch_make_huge_pte(pte, vma, NULL, 0); | ||
3036 | set_huge_pte_at(mm, address, ptep, pte); | 3033 | set_huge_pte_at(mm, address, ptep, pte); |
3037 | pages++; | 3034 | pages++; |
3038 | } | 3035 | } |