Skip to content
  • Adam Litke's avatar
    hugetlb: enforce quotas during reservation for shared mappings · 90d8b7e6
    Adam Litke authored
    When a MAP_SHARED mmap of a hugetlbfs file succeeds, huge pages are reserved
    to guarantee no problems will occur later when instantiating pages.  If quotas
    are in force, page instantiation could fail due to a race with another process
    or an oversized (but approved) shared mapping.
    To prevent these scenarios, debit the quota for the full reservation amount up
    front and credit the unused quota when the reservation is released.
    Signed-off-by: default avatarAdam Litke <>
    Cc: Ken Chen <>
    Cc: Andy Whitcroft <>
    Cc: Dave Hansen <>
    Cc: David Gibson <>
    Cc: William Lee Irwin III <>
    Signed-off-by: default avatarAndrew Morton <>
    Signed-off-by: default avatarLinus Torvalds <>