Commit 05ed69db authored by Wez's avatar Wez Committed by Commit Bot

Revert "[base] Don't try to decommit pages if they're about to be unmapped."

This reverts commit 0319eb27.

Reason for revert: Rationale for this change was incorrect; browser-side DiscardableSharedMemory objects _always_ have their handles closed.

Original change's description:
> [base] Don't try to decommit pages if they're about to be unmapped.
> 
> DiscardableSharedMemory::Purge() attempts to proactively discard pages
> to prevent slow-to-respond clients from keeping the pages live longer.
> 
> If the instance is in-process then these kernel calls are unnecessary
> since the memory is about to be unmapped anyway.
> 
> Bug: 1023693
> Change-Id: I2bc19eb64f3fdc009c5bf8c4ed6369b2b5081045
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911487
> Auto-Submit: Wez <wez@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Wez <wez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#714684}

TBR=dcheng@chromium.org,wez@chromium.org

Change-Id: I2b451e314a1ee73757cad5c492d6fd550eb83a09
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1023693
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913599Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714728}
parent 0b203c85
......@@ -368,15 +368,6 @@ bool DiscardableSharedMemory::Purge(Time current_time) {
return false;
}
// If |shared_memory_region_| handle is invalid then the memory will be
// released by the manager Unmap()ping |this| in response to Purge() returning
// true, so there is no point spending time calling discard APIs.
// This is the case for in-process instances.
if (!shared_memory_region_.IsValid()) {
last_known_usage_ = Time();
return true;
}
// The next section will release as much resource as can be done
// from the purging process, until the client process notices the
// purge and releases its own references.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment