forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make macOS shared memory implementation work on iOS as well
iOS currently uses a file-based implementation of shared memory (platform_shared_memory_region_posix.cc), that is responsible for a significant fraction of Chrome's disk writes overall. While Chrome on iOS never needs to share memory between processes, cross-platform primitives like mojo pipes use PlatformSharedMemoryRegion on iOS too. macOS currently uses an implementation of shared memory using mach_make_memory_entry_64. This implementation nearly works on iOS as-is, except that mach_vm_map is not available on iOS, which instead supports vm_map (and similarly doesn't support other mach_vm_* functions but supports their vm_* equivalents). macOS also supports vm_map. The main advantage of mach_vm_map and the other mach_vm_* functions is interoperability between 32-bit and 64-bit processes (e.g., sharing memory between such processes), which is not an issue for Chrome on macOS, since it is 64-bit only. This CL modifies the macOS implementation of PlatformSharedMemoryRegion to use vm_map instead of mach_vm_map, and uses this implementation on iOS as well. This fixes the excessive disk write issue on iOS, and also leaves iOS in a better state for a potential future where Chrome needs to share memory between processes. Change-Id: I9560cba636a371e684665d59869038e4f29b957e Bug: 1327411 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3673160 Commit-Queue: Ali Juma <ajuma@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Ken Rockot <rockot@google.com> Reviewed-by: Robert Sesek <rsesek@chromium.org> Cr-Commit-Position: refs/heads/main@{#1009355}
- Loading branch information
Showing
18 changed files
with
102 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.