diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2012-12-12 16:51:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-12 20:38:32 -0500 |
commit | 79da5407eeadc740fbf4b45d6df7d7f8e6adaf2c (patch) | |
tree | a9f1ca92b2711bb84a4707c904fcada24614d60e /include/linux/huge_mm.h | |
parent | d8a8e1f0da3d29d7268b3300c96a059d63901b76 (diff) |
thp: introduce sysfs knob to disable huge zero page
By default kernel tries to use huge zero page on read page fault. It's
possible to disable huge zero page by writing 0 or enable it back by
writing 1:
echo 0 >/sys/kernel/mm/transparent_hugepage/khugepaged/use_zero_page
echo 1 >/sys/kernel/mm/transparent_hugepage/khugepaged/use_zero_page
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/huge_mm.h')
-rw-r--r-- | include/linux/huge_mm.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 3132ea788581..092dc5305a32 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -39,6 +39,7 @@ enum transparent_hugepage_flag { | |||
39 | TRANSPARENT_HUGEPAGE_DEFRAG_FLAG, | 39 | TRANSPARENT_HUGEPAGE_DEFRAG_FLAG, |
40 | TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, | 40 | TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, |
41 | TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG, | 41 | TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG, |
42 | TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG, | ||
42 | #ifdef CONFIG_DEBUG_VM | 43 | #ifdef CONFIG_DEBUG_VM |
43 | TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG, | 44 | TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG, |
44 | #endif | 45 | #endif |
@@ -78,6 +79,9 @@ extern bool is_vma_temporary_stack(struct vm_area_struct *vma); | |||
78 | (transparent_hugepage_flags & \ | 79 | (transparent_hugepage_flags & \ |
79 | (1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG) && \ | 80 | (1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG) && \ |
80 | (__vma)->vm_flags & VM_HUGEPAGE)) | 81 | (__vma)->vm_flags & VM_HUGEPAGE)) |
82 | #define transparent_hugepage_use_zero_page() \ | ||
83 | (transparent_hugepage_flags & \ | ||
84 | (1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG)) | ||
81 | #ifdef CONFIG_DEBUG_VM | 85 | #ifdef CONFIG_DEBUG_VM |
82 | #define transparent_hugepage_debug_cow() \ | 86 | #define transparent_hugepage_debug_cow() \ |
83 | (transparent_hugepage_flags & \ | 87 | (transparent_hugepage_flags & \ |