The patch titled Subject: thp: make MADV_HUGEPAGE check for mm->def_flags has been removed from the -mm tree. Its filename was thp-make-madv_hugepage-check-for-mm-def_flags.patch This patch was dropped because an updated version will be merged ------------------------------------------------------ From: Gerald Schaefer <gerald.schaefer@xxxxxxxxxx> Subject: thp: make MADV_HUGEPAGE check for mm->def_flags This adds a check to hugepage_madvise(), to refuse MADV_HUGEPAGE if VM_NOHUGEPAGE is set in mm->def_flags. On s390, the VM_NOHUGEPAGE flag will be set in mm->def_flags for kvm processes, to prevent any future thp mappings. In order to also prevent MADV_HUGEPAGE on such an mm, hugepage_madvise() should check mm->def_flags. Signed-off-by: Gerald Schaefer <gerald.schaefer@xxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Hillf Danton <dhillf@xxxxxxxxx> Cc: Martin Schwidefsky <schwidefsky@xxxxxxxxxx> Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/huge_memory.c | 4 ++++ 1 file changed, 4 insertions(+) diff -puN mm/huge_memory.c~thp-make-madv_hugepage-check-for-mm-def_flags mm/huge_memory.c --- a/mm/huge_memory.c~thp-make-madv_hugepage-check-for-mm-def_flags +++ a/mm/huge_memory.c @@ -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_stru */ 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; /* _ Patches currently in -mm which might be from gerald.schaefer@xxxxxxxxxx are linux-next.patch thp-x86-introduce-have_arch_transparent_hugepage.patch thp-s390-thp-splitting-backend-for-s390.patch thp-s390-thp-pagetable-pre-allocation-for-s390.patch thp-s390-disable-thp-for-kvm-host-on-s390.patch thp-s390-architecture-backend-for-thp-on-s390.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html