• Andrea Arcangeli's avatar
    userfaultfd: prevent khugepaged to merge if userfaultfd is armed · 33c24f63
    Andrea Arcangeli authored
    If userfaultfd is armed on a certain vma we can't "fill" the holes
    with zeroes or we'll break the userland on demand paging. The holes if
    the userfault is armed, are really missing information (not zeroes)
    that the userland has to load from network or elsewhere.
    
    The same issue happens for wrprotected ptes that we can't just convert
    into a single writable pmd_trans_huge.
    
    We could however in theory still merge across zeropages if only
    VM_UFFD_MISSING is set (so if VM_UFFD_WP is not set)... that could be
    slightly improved but it'd be much more complex code for a tiny corner
    case.
    33c24f63
huge_memory.c 79.7 KB