Add the flag VM_CONTIG to vma structure to identify vmas which are backed by contiguous memory allocations. This flag is not propogated to child processes, so be sure to clear at fork time. Signed-off-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx> --- include/linux/mm.h | 1 + kernel/fork.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 065d99deb847..db82f172fbd1 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -189,6 +189,7 @@ extern unsigned int kobjsize(const void *objp); #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ +#define VM_CONTIG 0x00800000 /* Contiguous page backing */ #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ #define VM_WIPEONFORK 0x02000000 /* Wipe VMA contents in child. */ #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ diff --git a/kernel/fork.c b/kernel/fork.c index e702cb9ffbd8..d93b022e4909 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -665,7 +665,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm, goto fail_nomem_anon_vma_fork; } else if (anon_vma_fork(tmp, mpnt)) goto fail_nomem_anon_vma_fork; - tmp->vm_flags &= ~(VM_LOCKED | VM_LOCKONFAULT); + tmp->vm_flags &= ~(VM_LOCKED | VM_LOCKONFAULT | VM_CONTIG); tmp->vm_next = tmp->vm_prev = NULL; file = tmp->vm_file; if (file) { -- 2.13.6 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>