summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2013-09-12 18:14:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-12 18:38:03 -0400
commitc02925540ca7019465a43c00f8a3c0186ddace2b (patch)
tree3097ece86eedd0a01cf5dbc0a8f6c28fcbd1f4f7 /include/linux
parent128ec037bafe5905b2e6f2796f426a1d247d0066 (diff)
thp: consolidate code between handle_mm_fault() and do_huge_pmd_anonymous_page()
do_huge_pmd_anonymous_page() has copy-pasted piece of handle_mm_fault() to handle fallback path. Let's consolidate code back by introducing VM_FAULT_FALLBACK return code. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Hillf Danton <dhillf@gmail.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Hugh Dickins <hughd@google.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Jan Kara <jack@suse.cz> Cc: Mel Gorman <mgorman@suse.de> Cc: Andi Kleen <ak@linux.intel.com> Cc: Matthew Wilcox <willy@linux.intel.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/huge_mm.h3
-rw-r--r--include/linux/mm.h3
2 files changed, 2 insertions, 4 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index b60de92e2edc..3935428c57cf 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -96,9 +96,6 @@ extern int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,
96 pmd_t *dst_pmd, pmd_t *src_pmd, 96 pmd_t *dst_pmd, pmd_t *src_pmd,
97 struct vm_area_struct *vma, 97 struct vm_area_struct *vma,
98 unsigned long addr, unsigned long end); 98 unsigned long addr, unsigned long end);
99extern int handle_pte_fault(struct mm_struct *mm,
100 struct vm_area_struct *vma, unsigned long address,
101 pte_t *pte, pmd_t *pmd, unsigned int flags);
102extern int split_huge_page_to_list(struct page *page, struct list_head *list); 99extern int split_huge_page_to_list(struct page *page, struct list_head *list);
103static inline int split_huge_page(struct page *page) 100static inline int split_huge_page(struct page *page)
104{ 101{
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 928df792c005..8b6e55ee8855 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -877,11 +877,12 @@ static inline int page_mapped(struct page *page)
877#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ 877#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */
878#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ 878#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */
879#define VM_FAULT_RETRY 0x0400 /* ->fault blocked, must retry */ 879#define VM_FAULT_RETRY 0x0400 /* ->fault blocked, must retry */
880#define VM_FAULT_FALLBACK 0x0800 /* huge page fault failed, fall back to small */
880 881
881#define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */ 882#define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */
882 883
883#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON | \ 884#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON | \
884 VM_FAULT_HWPOISON_LARGE) 885 VM_FAULT_FALLBACK | VM_FAULT_HWPOISON_LARGE)
885 886
886/* Encode hstate index for a hwpoisoned large page */ 887/* Encode hstate index for a hwpoisoned large page */
887#define VM_FAULT_SET_HINDEX(x) ((x) << 12) 888#define VM_FAULT_SET_HINDEX(x) ((x) << 12)