Messages in this thread Patch in this message | | | Date | Wed, 22 Jan 2014 18:46:46 +0100 | From | Oleg Nesterov <> | Subject | [PATCH 2/2] mm: thp: kill the bogus ->def_flags check in hugepage_madvise() |
| |
hugepage_madvise() checks "mm->def_flags & VM_NOHUGEPAGE" but this can be never true, currently mm->def_flags can only have VM_LOCKED.
And otoh we might want to add VM_NOHUGEPAGE into ->def_flags but override it in vma->vm_flags via madvise(MADV_HUGEPAGE).
Signed-off-by: Oleg Nesterov <oleg@redhat.com> --- mm/huge_memory.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index bccd5a6..e8b656c 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1941,8 +1941,6 @@ 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; /* -- 1.5.5.1
| |