Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm: limit AddressSpace overmapping during async page loading
On platforms that do not create page table entries in platform.AddressSpace.MapFile(precommit=false), i.e. platforms for which platform.Platform.MapUnit() == 0, platform.AddressSpace.MapFile() is generally implemented as some form of host mmap(), which only synchronously creates host kernel VMAs (virtual memory areas) and creates page table entries lazily in response to application faults. On such platforms, MM.mapAsLocked() creates the largest possible host VMAs since doing so reduces future sentry-handled page faults and has effectively no additional cost. However, when async page loading is active, this must wait for all mapped pages to be loaded, which may result in the faulting application blocking for significantly longer than expected (in experiments, a single page fault could result in waiting for up to 64GB of data to be loaded). In such cases, additionally constrain mapped sizes to limit wait times. PiperOrigin-RevId: 680699946
- Loading branch information