diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2011-01-13 18:47:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:47 -0500 |
commit | a664b2d8555c659127bf8fe049a58449d394a707 (patch) | |
tree | 14771f4ab93a9dda98174f21e0361a77e2aebfa6 /mm/madvise.c | |
parent | 1ddd6db43a08cba56c7ee920800980862086f1c3 (diff) |
thp: madvise(MADV_NOHUGEPAGE)
Add madvise MADV_NOHUGEPAGE to mark regions that are not important to be
hugepage backed. Return -EINVAL if the vma is not of an anonymous type,
or the feature isn't built into the kernel. Never silently return
success.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/madvise.c')
-rw-r--r-- | mm/madvise.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/madvise.c b/mm/madvise.c index ecde40a401c1..bbac126e03ed 100644 --- a/mm/madvise.c +++ b/mm/madvise.c | |||
@@ -72,7 +72,8 @@ static long madvise_behavior(struct vm_area_struct * vma, | |||
72 | goto out; | 72 | goto out; |
73 | break; | 73 | break; |
74 | case MADV_HUGEPAGE: | 74 | case MADV_HUGEPAGE: |
75 | error = hugepage_madvise(&new_flags); | 75 | case MADV_NOHUGEPAGE: |
76 | error = hugepage_madvise(&new_flags, behavior); | ||
76 | if (error) | 77 | if (error) |
77 | goto out; | 78 | goto out; |
78 | break; | 79 | break; |
@@ -290,6 +291,7 @@ madvise_behavior_valid(int behavior) | |||
290 | #endif | 291 | #endif |
291 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 292 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
292 | case MADV_HUGEPAGE: | 293 | case MADV_HUGEPAGE: |
294 | case MADV_NOHUGEPAGE: | ||
293 | #endif | 295 | #endif |
294 | return 1; | 296 | return 1; |
295 | 297 | ||