|
@@ -1450,6 +1450,8 @@ out:
|
|
|
int hugepage_madvise(struct vm_area_struct *vma,
|
|
|
unsigned long *vm_flags, int advice)
|
|
|
{
|
|
|
+ struct mm_struct *mm = vma->vm_mm;
|
|
|
+
|
|
|
switch (advice) {
|
|
|
case MADV_HUGEPAGE:
|
|
|
/*
|
|
@@ -1457,6 +1459,8 @@ int hugepage_madvise(struct vm_area_struct *vma,
|
|
|
*/
|
|
|
if (*vm_flags & (VM_HUGEPAGE | VM_NO_THP))
|
|
|
return -EINVAL;
|
|
|
+ if (mm->def_flags & VM_NOHUGEPAGE)
|
|
|
+ return -EINVAL;
|
|
|
*vm_flags &= ~VM_NOHUGEPAGE;
|
|
|
*vm_flags |= VM_HUGEPAGE;
|
|
|
/*
|