diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-12 13:15:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-12 13:15:10 -0400 |
commit | 1021a645344d4a77333e19e60d37b9343be0d7b7 (patch) | |
tree | 7a78ab55f27f97209ed1b85ccfd88c6d5b8416d3 /include | |
parent | 7367f5b013fee33f7d40a5a10a39d5134f529ec8 (diff) | |
parent | 28957a5467bab9ed51a237d21e31055fad987887 (diff) |
Merge branch 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6
* 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6:
hugetlb: add missing unlock in avoidcopy path in hugetlb_cow()
hwpoison: rename CONFIG
HWPOISON, hugetlb: support hwpoison injection for hugepage
HWPOISON, hugetlb: detect hwpoison in hugetlb code
HWPOISON, hugetlb: isolate corrupted hugepage
HWPOISON, hugetlb: maintain mce_bad_pages in handling hugepage error
HWPOISON, hugetlb: set/clear PG_hwpoison bits on hugepage
HWPOISON, hugetlb: enable error handling path for hugepage
hugetlb, rmap: add reverse mapping for hugepage
hugetlb: move definition of is_vm_hugetlb_page() to hugepage_inline.h
Fix up trivial conflicts in mm/memory-failure.c
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hugetlb.h | 14 | ||||
-rw-r--r-- | include/linux/hugetlb_inline.h | 22 | ||||
-rw-r--r-- | include/linux/pagemap.h | 9 | ||||
-rw-r--r-- | include/linux/poison.h | 9 | ||||
-rw-r--r-- | include/linux/rmap.h | 5 |
5 files changed, 39 insertions, 20 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 78b4bc64c006..f479700df61b 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_HUGETLB_H | 2 | #define _LINUX_HUGETLB_H |
3 | 3 | ||
4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
5 | #include <linux/hugetlb_inline.h> | ||
5 | 6 | ||
6 | struct ctl_table; | 7 | struct ctl_table; |
7 | struct user_struct; | 8 | struct user_struct; |
@@ -14,11 +15,6 @@ struct user_struct; | |||
14 | 15 | ||
15 | int PageHuge(struct page *page); | 16 | int PageHuge(struct page *page); |
16 | 17 | ||
17 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | ||
18 | { | ||
19 | return vma->vm_flags & VM_HUGETLB; | ||
20 | } | ||
21 | |||
22 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | 18 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); |
23 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); | 19 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
24 | int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); | 20 | int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
@@ -47,6 +43,7 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to, | |||
47 | struct vm_area_struct *vma, | 43 | struct vm_area_struct *vma, |
48 | int acctflags); | 44 | int acctflags); |
49 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | 45 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); |
46 | void __isolate_hwpoisoned_huge_page(struct page *page); | ||
50 | 47 | ||
51 | extern unsigned long hugepages_treat_as_movable; | 48 | extern unsigned long hugepages_treat_as_movable; |
52 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 49 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
@@ -77,11 +74,6 @@ static inline int PageHuge(struct page *page) | |||
77 | return 0; | 74 | return 0; |
78 | } | 75 | } |
79 | 76 | ||
80 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | ||
81 | { | ||
82 | return 0; | ||
83 | } | ||
84 | |||
85 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) | 77 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) |
86 | { | 78 | { |
87 | } | 79 | } |
@@ -108,6 +100,8 @@ static inline void hugetlb_report_meminfo(struct seq_file *m) | |||
108 | #define is_hugepage_only_range(mm, addr, len) 0 | 100 | #define is_hugepage_only_range(mm, addr, len) 0 |
109 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) | 101 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
110 | #define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; }) | 102 | #define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; }) |
103 | #define huge_pte_offset(mm, address) 0 | ||
104 | #define __isolate_hwpoisoned_huge_page(page) 0 | ||
111 | 105 | ||
112 | #define hugetlb_change_protection(vma, address, end, newprot) | 106 | #define hugetlb_change_protection(vma, address, end, newprot) |
113 | 107 | ||
diff --git a/include/linux/hugetlb_inline.h b/include/linux/hugetlb_inline.h new file mode 100644 index 000000000000..6931489a5c14 --- /dev/null +++ b/include/linux/hugetlb_inline.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef _LINUX_HUGETLB_INLINE_H | ||
2 | #define _LINUX_HUGETLB_INLINE_H | ||
3 | |||
4 | #ifdef CONFIG_HUGETLB_PAGE | ||
5 | |||
6 | #include <linux/mm.h> | ||
7 | |||
8 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | ||
9 | { | ||
10 | return vma->vm_flags & VM_HUGETLB; | ||
11 | } | ||
12 | |||
13 | #else | ||
14 | |||
15 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | ||
16 | { | ||
17 | return 0; | ||
18 | } | ||
19 | |||
20 | #endif | ||
21 | |||
22 | #endif | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 78a702ce4fcb..e12cdc6d79ee 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/gfp.h> | 13 | #include <linux/gfp.h> |
14 | #include <linux/bitops.h> | 14 | #include <linux/bitops.h> |
15 | #include <linux/hardirq.h> /* for in_interrupt() */ | 15 | #include <linux/hardirq.h> /* for in_interrupt() */ |
16 | #include <linux/hugetlb_inline.h> | ||
16 | 17 | ||
17 | /* | 18 | /* |
18 | * Bits in mapping->flags. The lower __GFP_BITS_SHIFT bits are the page | 19 | * Bits in mapping->flags. The lower __GFP_BITS_SHIFT bits are the page |
@@ -281,10 +282,16 @@ static inline loff_t page_offset(struct page *page) | |||
281 | return ((loff_t)page->index) << PAGE_CACHE_SHIFT; | 282 | return ((loff_t)page->index) << PAGE_CACHE_SHIFT; |
282 | } | 283 | } |
283 | 284 | ||
285 | extern pgoff_t linear_hugepage_index(struct vm_area_struct *vma, | ||
286 | unsigned long address); | ||
287 | |||
284 | static inline pgoff_t linear_page_index(struct vm_area_struct *vma, | 288 | static inline pgoff_t linear_page_index(struct vm_area_struct *vma, |
285 | unsigned long address) | 289 | unsigned long address) |
286 | { | 290 | { |
287 | pgoff_t pgoff = (address - vma->vm_start) >> PAGE_SHIFT; | 291 | pgoff_t pgoff; |
292 | if (unlikely(is_vm_hugetlb_page(vma))) | ||
293 | return linear_hugepage_index(vma, address); | ||
294 | pgoff = (address - vma->vm_start) >> PAGE_SHIFT; | ||
288 | pgoff += vma->vm_pgoff; | 295 | pgoff += vma->vm_pgoff; |
289 | return pgoff >> (PAGE_CACHE_SHIFT - PAGE_SHIFT); | 296 | return pgoff >> (PAGE_CACHE_SHIFT - PAGE_SHIFT); |
290 | } | 297 | } |
diff --git a/include/linux/poison.h b/include/linux/poison.h index 34066ffd893d..2110a81c5e2a 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
@@ -48,15 +48,6 @@ | |||
48 | #define POISON_FREE 0x6b /* for use-after-free poisoning */ | 48 | #define POISON_FREE 0x6b /* for use-after-free poisoning */ |
49 | #define POISON_END 0xa5 /* end-byte of poisoning */ | 49 | #define POISON_END 0xa5 /* end-byte of poisoning */ |
50 | 50 | ||
51 | /********** mm/hugetlb.c **********/ | ||
52 | /* | ||
53 | * Private mappings of hugetlb pages use this poisoned value for | ||
54 | * page->mapping. The core VM should not be doing anything with this mapping | ||
55 | * but futex requires the existence of some page->mapping value even though it | ||
56 | * is unused if PAGE_MAPPING_ANON is set. | ||
57 | */ | ||
58 | #define HUGETLB_POISON ((void *)(0x00300300 + POISON_POINTER_DELTA + PAGE_MAPPING_ANON)) | ||
59 | |||
60 | /********** arch/$ARCH/mm/init.c **********/ | 51 | /********** arch/$ARCH/mm/init.c **********/ |
61 | #define POISON_FREE_INITMEM 0xcc | 52 | #define POISON_FREE_INITMEM 0xcc |
62 | 53 | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index d6661de56f30..31b2fd75dcba 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -168,6 +168,11 @@ void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned lon | |||
168 | void page_add_file_rmap(struct page *); | 168 | void page_add_file_rmap(struct page *); |
169 | void page_remove_rmap(struct page *); | 169 | void page_remove_rmap(struct page *); |
170 | 170 | ||
171 | void hugepage_add_anon_rmap(struct page *, struct vm_area_struct *, | ||
172 | unsigned long); | ||
173 | void hugepage_add_new_anon_rmap(struct page *, struct vm_area_struct *, | ||
174 | unsigned long); | ||
175 | |||
171 | static inline void page_dup_rmap(struct page *page) | 176 | static inline void page_dup_rmap(struct page *page) |
172 | { | 177 | { |
173 | atomic_inc(&page->_mapcount); | 178 | atomic_inc(&page->_mapcount); |