0

I'm reading through the Linux kernel's page fault handler (linux-4.14.198), and noticed the following block of code:

        /* Deliver the page fault to userland, check inside PT lock */
        if (userfaultfd_missing(vma)) {
            pte_unmap_unlock(vmf->pte, vmf->ptl);
            return handle_userfault(vmf, VM_UFFD_MISSING);
        }

The definition of userfaultfd_missing is that vm_flags includes VM_UFFD_MISSING. However, the only comment on this flag is the cryptic missing pages tracking comment on the macro definition.

What does this flag mean, and what exactly is "userfault" handling?

Marco Bonelli
  • 63,369
  • 21
  • 118
  • 128
merlin2011
  • 71,677
  • 44
  • 195
  • 329
  • https://man7.org/linux/man-pages/man2/userfaultfd.2.html – oakad Nov 25 '20 at 01:37
  • These days, kernel can either handle page faults itself, as in the days of old, or engage an user space helper. Very useful for VMs it seems. – oakad Nov 25 '20 at 01:38

0 Answers0