Bug 1716727 - patchset #2 [2/2] Deexperimentalize stalling code r=glandium

Although further experiments and refinements are called for, the effect
of this patch has been overall significantly positive. Let it ride the
trains as-is for Fx 105, rather than blocking on those experiments.

(This patch conflicts with D153784, which will need to be rebased and
moved to a new Bugzilla bug.)

Depends on D153783

Differential Revision: https://phabricator.services.mozilla.com/D154839
This commit is contained in:
Ray Kraesig 2022-08-18 20:32:26 +00:00
parent b70021268a
commit 52e0d53fb0
4 changed files with 4 additions and 26 deletions

View File

@ -59,20 +59,4 @@ DisableStlWrapping()
if CONFIG["CC_TYPE"] == "clang-cl":
AllowCompilerWarnings() # workaround for bug 1090497
# Experimental: stall and retry on OOM (bug 1716727).
#
# This _will_ induce performance regressions in some (hopefully rare) contexts:
# we don't know whether any given allocation is supposed to be fallible, so we
# have to stall on any OOMed allocation.
#
# This is remediable, in theory. For now, though, we simply restrict it to
# Nightly, to give us enough data to determine whether this approach is worth
# the trouble of pursuing further.
#
# This experiment should probably not be active beyond 2022-09-01, and may be
# terminated early if the performance regression turns out to be worse than
# anticipated.
if CONFIG["NIGHTLY_BUILD"] and CONFIG["OS_TARGET"] == "WINNT":
DEFINES["MOZ_STALL_ON_OOM"] = True
REQUIRES_UNIFIED_BUILD = True

View File

@ -1369,12 +1369,10 @@ static inline void ApplyZeroOrJunk(void* aPtr, size_t aSize) {
// Whether the current process should always stall, or only stall once.
static bool sShouldAlwaysStall = true;
MOZ_JEMALLOC_API void mozjemalloc_experiment_win_set_always_stall(bool aVal) {
MOZ_JEMALLOC_API void mozjemalloc_win_set_always_stall(bool aVal) {
sShouldAlwaysStall = aVal;
}
# ifdef MOZ_STALL_ON_OOM
// Implementation of VirtualAlloc wrapper (bug 1716727).
namespace MozAllocRetries {
@ -1455,9 +1453,6 @@ static bool ShouldStallAndRetry() {
} // namespace MozAllocRetries
using MozAllocRetries::MozVirtualAlloc;
# else
# define MozVirtualAlloc VirtualAlloc
# endif // MOZ_STALL_ON_OOM
#endif // XP_WIN
// ***************************************************************************

View File

@ -61,9 +61,9 @@ static inline void jemalloc_stats(jemalloc_stats_t* aStats) {
}
# endif
// Temporary configurator for experiment associated with bug 1716727.
// Configurator for delaying on OOM. See bug 1716727.
# if defined(XP_WIN)
MOZ_JEMALLOC_API void mozjemalloc_experiment_win_set_always_stall(bool);
MOZ_JEMALLOC_API void mozjemalloc_win_set_always_stall(bool);
# endif
#endif // MOZ_MEMORY

View File

@ -275,8 +275,7 @@ void XRE_SetProcessType(const char* aProcessTypeString) {
//
// For child processes, an obvious OOM-crash may be preferable to slow
// performance. Retry at most once per process, then give up.
mozjemalloc_experiment_win_set_always_stall(processType ==
GeckoProcessType_Default);
mozjemalloc_win_set_always_stall(processType == GeckoProcessType_Default);
#endif
}