[PartitionAlloc] Make pages inaccessible *after* discarding
crrev.com/c/2550119 caused a surprising memory regression on Mac. It was taken care of in crrev.com/c/2563038, by "relaxing" one caller, but the question of other caller remained. Turns out that reordering SetSystemPagesAccess past DiscardSystemPages in DecommitSystemPages also takes care of that regression: https://pinpoint-dot-chromeperf.appspot.com/job/1425cfb7520000 This is unfortunate, as preferably we'd want to avoid a window when discarded pages can be faulted in. However, prior to crrev.com/c/2550119 almost all callers (except one) would call SetSystemPagesAccess after DiscardSystemPages, so in that sense this CL brings back the old, well tested behavior. Similarly reorder operations in RecommitSystemPages. The callers were split 50/50 on this prior to crrev.com/c/2550119 and no regressions were observed, so it likely doesn't matter either way. It just seems to make more sense to have operations in the opposite order to DecommitSystemPages. PS This CL doesn't change memory usage on Linux or Android, but also no regressions were observed there to begin with. https://pinpoint-dot-chromeperf.appspot.com/job/172620fb520000 https://pinpoint-dot-chromeperf.appspot.com/job/15212cd7520000 PS2 It has been confirmed theoretically that ordering on Fuchsia shouldn't matter, so stick to the preferred ordering. Bug: 1153021 Change-Id: Icb937ffed2420859e6006aa2e1af555661bfe541 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2563052Reviewed-by:Erik Chen <erikchen@chromium.org> Reviewed-by:
Wez <wez@chromium.org> Commit-Queue: Bartek Nowierski <bartekn@chromium.org> Auto-Submit: Bartek Nowierski <bartekn@chromium.org> Cr-Commit-Position: refs/heads/master@{#833631}
Showing
Please register or sign in to comment