Closed Bug 1864828 Opened 2 years ago Closed 2 years ago

Set PHC minimum memory size from a pref

Categories

(Core :: Memory Allocator, task)

task

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: pbone, Assigned: pbone)

References

(Blocks 1 open bug)

Details

Attachments

(2 external files, 1 obsolete file)

PHC has a few parameters that are currently defined as constants. These should be prefs so they can be tuned more easily. They are:

  • The size of the PHC area.
  • The probability before the first PHC allocation.
  • The propability for later PHC allocations.

Depends on D194363

Blocks: 1866208
Summary: PHC should be tunable by prefs → Set PHC minimum minimum memory size from a pref
See Also: → 1867190
See Also: → 1867191
Attachment #9364929 - Attachment description: Bug 1864828 - Add a pref for PHC's minimum RAM size r=glandium → Bug 1864828 - pt 2. Add a pref for PHC's minimum RAM size r=glandium

Comment on attachment 9364930 [details]
WIP: Bug 1864828 - Make the PHC probability dynamic

Revision D194364 was moved to bug 1867190. Setting attachment 9364930 [details] to obsolete.

Attachment #9364930 - Attachment is obsolete: true
Summary: Set PHC minimum minimum memory size from a pref → Set PHC minimum memory size from a pref
Summary: Set PHC minimum memory size from a pref → Set PHC minimum memory size from a pref
Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ba88f119b1fc pt 1. Move operators to create literals with units into mfbt/ r=glandium https://hg.mozilla.org/integration/autoland/rev/c1b4a8307702 pt 2. Add a pref for PHC's minimum RAM size r=glandium

Backed out for causing build bustages on TestJemalloc.cpp.

[task 2023-11-30T05:11:29.852Z] 05:11:29     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/memory/gtest'
[task 2023-11-30T05:11:29.855Z] 05:11:29     INFO -  /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang++ --sysroot /builds/worker/fetches/sysroot-x86_64-linux-gnu -o Unified_cpp_memory_gtest0.o -c  -I/builds/worker/workspace/obj-build/dist/stl_wrappers -I/builds/worker/workspace/obj-build/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -ftrivial-auto-var-init=pattern -DDEBUG=1 -DMOZ_PHC -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/memory/gtest -I/builds/worker/workspace/obj-build/memory/gtest -I/builds/worker/checkouts/gecko/memory/build -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-build/mozilla-config.h -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fcrash-diagnostics-dir=/builds/worker/artifacts -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O2 -fno-omit-frame-pointer -funwind-tables -Werror -Wall -Wbitfield-enum-conversion -Wdeprecated-this-capture -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtautological-constant-in-range-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wunused-but-set-parameter -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wc++2a-compat -Wenum-compare-conditional -Wenum-float-conversion -Wno-error=deprecated -Wno-error=deprecated-anon-enum-enum-conversion -Wno-error=deprecated-enum-enum-conversion -Wno-error=deprecated-pragma -Wno-error=deprecated-this-capture -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wformat -Wformat-security -Wno-psabi -Wthread-safety -Wno-error=builtin-macro-redefined -Wno-unknown-warning-option -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/Unified_cpp_memory_gtest0.o.pp   Unified_cpp_memory_gtest0.cpp
[task 2023-11-30T05:11:29.855Z] 05:11:29     INFO -  In file included from Unified_cpp_memory_gtest0.cpp:2:
[task 2023-11-30T05:11:29.856Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:65:28: error: no matching literal operator for call to 'operator""_KiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.856Z] 05:11:29     INFO -     65 |   for (size_t n = 0; n < 16_KiB; n++) ASSERT_NO_FATAL_FAILURE(TestOne(n));
[task 2023-11-30T05:11:29.856Z] 05:11:29     INFO -        |                            ^
[task 2023-11-30T05:11:29.857Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:67:21: error: no matching literal operator for call to 'operator""_KiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.857Z] 05:11:29     INFO -     67 |   for (size_t n = 16_KiB; n < 1_MiB; n += 4_KiB)
[task 2023-11-30T05:11:29.857Z] 05:11:29     INFO -        |                     ^
[task 2023-11-30T05:11:29.858Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:67:32: error: no matching literal operator for call to 'operator""_MiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.858Z] 05:11:29     INFO -     67 |   for (size_t n = 16_KiB; n < 1_MiB; n += 4_KiB)
[task 2023-11-30T05:11:29.858Z] 05:11:29     INFO -        |                                ^
[task 2023-11-30T05:11:29.859Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:67:44: error: no matching literal operator for call to 'operator""_KiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.859Z] 05:11:29     INFO -     67 |   for (size_t n = 16_KiB; n < 1_MiB; n += 4_KiB)
[task 2023-11-30T05:11:29.860Z] 05:11:29     INFO -        |                                            ^
[task 2023-11-30T05:11:29.860Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:70:20: error: no matching literal operator for call to 'operator""_MiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.860Z] 05:11:29     INFO -     70 |   for (size_t n = 1_MiB; n < 8_MiB; n += 128_KiB)
[task 2023-11-30T05:11:29.861Z] 05:11:29     INFO -        |                    ^
[task 2023-11-30T05:11:29.861Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:70:31: error: no matching literal operator for call to 'operator""_MiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.861Z] 05:11:29     INFO -     70 |   for (size_t n = 1_MiB; n < 8_MiB; n += 128_KiB)
[task 2023-11-30T05:11:29.862Z] 05:11:29     INFO -        |                               ^
[task 2023-11-30T05:11:29.862Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:70:45: error: no matching literal operator for call to 'operator""_KiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.864Z] 05:11:29     INFO -     70 |   for (size_t n = 1_MiB; n < 8_MiB; n += 128_KiB)
[task 2023-11-30T05:11:29.864Z] 05:11:29     INFO -        |                                             ^
[task 2023-11-30T05:11:29.864Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:124:32: error: no matching literal operator for call to 'operator""_KiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.864Z] 05:11:29     INFO -    124 |   for (size_t n = small_max + 1_KiB; n <= stats.large_max; n += 1_KiB) {
[task 2023-11-30T05:11:29.864Z] 05:11:29     INFO -        |                                ^
[task 2023-11-30T05:11:29.864Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:124:66: error: no matching literal operator for call to 'operator""_KiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.864Z] 05:11:29     INFO -    124 |   for (size_t n = small_max + 1_KiB; n <= stats.large_max; n += 1_KiB) {
[task 2023-11-30T05:11:29.864Z] 05:11:29     INFO -        |                                                                  ^
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:135:43: error: no matching literal operator for call to 'operator""_MiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -    135 |   for (size_t n = stats.chunksize; n <= 10_MiB; n += 512_KiB) {
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -        |                                           ^
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:135:57: error: no matching literal operator for call to 'operator""_KiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -    135 |   for (size_t n = stats.chunksize; n <= 10_MiB; n += 512_KiB) {
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -        |                                                         ^
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:251:58: error: no matching literal operator for call to 'operator""_KiB' with argument of type 'long double' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -    251 | size_t sSizes[] = {1,      42,      79,      918,     1.4_KiB,
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -        |                                                          ^
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:252:22: error: no matching literal operator for call to 'operator""_KiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -    252 |                    73_KiB, 129_KiB, 1.1_MiB, 2.6_MiB, 5.1_MiB};
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -        |                      ^
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:252:31: error: no matching literal operator for call to 'operator""_KiB' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -    252 |                    73_KiB, 129_KiB, 1.1_MiB, 2.6_MiB, 5.1_MiB};
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -        |                               ^
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:252:40: error: no matching literal operator for call to 'operator""_MiB' with argument of type 'long double' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -    252 |                    73_KiB, 129_KiB, 1.1_MiB, 2.6_MiB, 5.1_MiB};
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -        |                                        ^
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:252:49: error: no matching literal operator for call to 'operator""_MiB' with argument of type 'long double' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -    252 |                    73_KiB, 129_KiB, 1.1_MiB, 2.6_MiB, 5.1_MiB};
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -        |                                                 ^
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:252:58: error: no matching literal operator for call to 'operator""_MiB' with argument of type 'long double' or 'const char *', and no matching literal operator template
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -    252 |                    73_KiB, 129_KiB, 1.1_MiB, 2.6_MiB, 5.1_MiB};
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -        |                                                          ^
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:285:27: error: cannot use incomplete type 'size_t[]' (aka 'unsigned long[]') as a range
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -    285 |   for (size_t from_size : sSizes) {
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -        |                           ^
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  /builds/worker/checkouts/gecko/memory/gtest/TestJemalloc.cpp:287:27: error: cannot use incomplete type 'size_t[]' (aka 'unsigned long[]') as a range
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -    287 |     for (size_t to_size : sSizes) {
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -        |                           ^
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -  fatal error: too many errors emitted, stopping now [-ferror-limit=]
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -  20 errors generated.
[task 2023-11-30T05:11:29.870Z] 05:11:29    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:690: Unified_cpp_memory_gtest0.o] Error 1
[task 2023-11-30T05:11:29.870Z] 05:11:29     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/memory/gtest'
Flags: needinfo?(pbone)

On Solairs it's causing also following error:

16:57.75 /builds/psumbera/mozilla-central-build/ipc/glue/BackgroundParentImpl.cpp: In member function ‘virtual mozilla::ipc::IPCResult mozilla::ipc::BackgroundParentImpl::RecvRequestCameraAccess(const bool&, mozilla::ipc::PBackgroundParent::RequestCameraAccessResolver&&)’:
16:57.75 /builds/psumbera/mozilla-central-build/ipc/glue/BackgroundParentImpl.cpp:1377:12: error: no match for call to ‘(mozilla::ipc::PBackgroundParent::RequestCameraAccessResolver {aka std::function<void(const mozilla::camera::CamerasAccessStatus&)>}) (const nsresult&)’
16:57.75  1377 |   aResolver(NS_ERROR_NOT_IMPLEMENTED);
16:57.75       |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
16:57.75 In file included from /usr/gcc/11/include/c++/11.4.0/functional:59,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/system_wrappers/functional:3,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/stl_wrappers/functional:62,
16:57.75                  from /usr/gcc/11/include/c++/11.4.0/pstl/glue_algorithm_defs.h:13,
16:57.75                  from /usr/gcc/11/include/c++/11.4.0/algorithm:74,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/system_wrappers/algorithm:3,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/stl_wrappers/algorithm:62,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/mozilla/Result.h:12,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/mozilla/ResultExtensions.h:48,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/nsTSubstring.h:21,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/nsAString.h:20,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/nsString.h:16,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/ipc/ipdl/_ipdlheaders/mozilla/ipc/PBackground.h:12,
16:57.75                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/ipc/ipdl/_ipdlheaders/mozilla/ipc/PBackgroundParent.h:9,
16:57.75                  from /builds/psumbera/mozilla-central-build/ipc/glue/BackgroundParentImpl.h:10,
16:57.75                  from /builds/psumbera/mozilla-central-build/ipc/glue/BackgroundParentImpl.cpp:7:
16:57.75 /usr/gcc/11/include/c++/11.4.0/bits/std_function.h:586:7: note: candidate: ‘_Res std::function<_Res(_ArgTypes ...)>::operator()(_ArgTypes ...) const [with _Res = void; _ArgTypes = {const mozilla::camera::CamerasAccessStatus&}]’
16:57.75   586 |       operator()(_ArgTypes... __args) const
16:57.75       |       ^~~~~~~~
Regressions: 1867772
No longer regressions: 1867772

Thanks.

Flags: needinfo?(pbone)
Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e2cf5cf40bda pt 1. Move operators to create literals with units into mfbt/ r=glandium https://hg.mozilla.org/integration/autoland/rev/27b4b4382993 pt 2. Add a pref for PHC's minimum RAM size r=glandium
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: