Closed Bug 1531626 Opened 6 years ago Closed 5 years ago

Add a minimum nursery size gc parameter

Categories

(Core :: JavaScript: GC, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox67 --- wontfix
firefox68 --- fixed

People

(Reporter: pbone, Assigned: pbone)

References

Details

Attachments

(6 files, 1 obsolete file)

Minimum nursery size is hardcoded in gc/Nursery.h, make it a parameter.

Assignee: nobody → pbone
Status: NEW → ASSIGNED
Priority: -- → P2

Depends on D21669

Blocks: 1532838
Attachment #9047644 - Attachment is obsolete: true

This change moves some details of maybeResizeNursery() into a new function
that will resize the nursery in one of the situations where the nursery has
a fixed size.

It also simplifies the clamping code.

Depends on D21669

The nursery capacity included the usable size of nursery chunks. However
it'll simplify the parameters for the nursery size if it uses whole
nursery chunks, so include the chunk trailers in the nursery capacity.

This means changing the subchunk calculations slightly to handle the
sub-chunk/whole-chunk mode transitions.

Depends on D22285

We were rounding up for growing the nursery, rounding down for shrinking.
If we round nearest in all cases then we can also round our minimum and
maximum size parameters the same way.

Depends on D22286

Attachment #9047645 - Attachment description: Bug 1531626 - Introduce a GC_MIN_NURSERY_BYTES parameter → Bug 1531626 - Introduce a GC_MIN_NURSERY_BYTES parameter r=jonco!
Attachment #9047643 - Attachment description: Bug 1531626 - Add missing keys to GCRuntime::getParameter() r=jonco! → Bug 1531626 - (part 1) Add missing keys to GCRuntime::getParameter() r=jonco!
Attachment #9048817 - Attachment description: Bug 1531626 - Refactor Nursery::maybeResizeNursery r=jonco! → Bug 1531626 - (part 2) Refactor Nursery::maybeResizeNursery r=jonco!
Attachment #9048818 - Attachment description: Bug 1531626 - Include chunk trailers in nursery capacity r=jonco! → Bug 1531626 - (part 3) Include chunk trailers in nursery capacity r=jonco!
Attachment #9048819 - Attachment description: Bug 1531626 - Always round-nearest for nursery size r=jonco! → Bug 1531626 - (part 4) Always round-nearest for nursery size r=jonco!
Attachment #9047645 - Attachment description: Bug 1531626 - Introduce a GC_MIN_NURSERY_BYTES parameter r=jonco! → Bug 1531626 - (part 5) Introduce a GC_MIN_NURSERY_BYTES parameter r=jonco!

This will land in FF68

You've updated part 3 in phabricator but you didn't address my question about Nursery::growAllocableSpace:

OK, the next patch does simplify this but keeps the Min(..., NurseryChunkUsableSize) part, which I'm not sure about.

At the moment this looks like capacity_ ends up as one of: a) a multiple of ChunkSize, b) a multiple of SubChunkSize, c) NurseryChunkUsableSize. Since this patch is to include the trailer size in the capacity, the last possibility seems wrong to me.

Can you explain why this is OK or do something about it? Cheers.

Flags: needinfo?(pbone)

Sorry about that, some phabricator confusion and I didn't realise I hadn't submitted my reply from last week.

Flags: needinfo?(pbone)
Pushed by pbone@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d2a8cc3ca43e
(part 1) Add missing keys to GCRuntime::getParameter() r=jonco
https://hg.mozilla.org/integration/autoland/rev/782656ddec8a
(part 2) Refactor Nursery::maybeResizeNursery r=jonco
https://hg.mozilla.org/integration/autoland/rev/fb099fd16c0c
(part 3) Include chunk trailers in nursery capacity r=jonco
https://hg.mozilla.org/integration/autoland/rev/f754814d9ade
(part 4) Always round-nearest for nursery size r=jonco
https://hg.mozilla.org/integration/autoland/rev/31825d66ed83
(part 5) Introduce a GC_MIN_NURSERY_BYTES parameter r=jonco

Backed out 6 changesets (bug 1528159, bug 1531626) for mozcrash.py - spidermonkey

Backout: https://hg.mozilla.org/integration/autoland/rev/91578d6aeae5509fc238450943e8a11d0c7492ee

Failure push: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=235352629&
revision=d1e0b848dfcaf4387201fa2807eb807279f369e0

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=235352629&repo=autoland&lineNumber=4447

[task 2019-03-22T04:30:55.282Z] TEST-PASS | testGCStoreBufferRAssertion failure: false (tunables.setParameter(JSGC_MAX_NURSERY_BYTES, maxNurseryBytes, lock)), at /builds/worker/workspace/build/src/js/src/gc/GC.cpp:1265
[task 2019-03-22T04:30:55.298Z] in directory /builds/worker/workspace/build/src/obj-spider, running ['/builds/worker/workspace/build/src/obj-spider/_virtualenvs/init/bin/python', '/builds/worker/workspace/build/src/testing/mozbase/mozcrash/mozcrash/mozcrash.py', '/tmp', '/builds/worker/workspace/build/src/obj-spider/dist/crashreporter-symbols']
[task 2019-03-22T04:30:55.375Z] mozcrash INFO | Copy/paste: /builds/worker/workspace/breakpad-tools/minidump_stackwalk /tmp/ed98e438-3d2f-4b28-1b6e32b7-8104aec8.dmp /builds/worker/workspace/build/src/obj-spider/dist/crashreporter-symbols
[task 2019-03-22T04:30:56.466Z] mozcrash INFO | Saved minidump as /builds/worker/ed98e438-3d2f-4b28-1b6e32b7-8104aec8.dmp
[task 2019-03-22T04:30:56.466Z] PROCESS-CRASH | mozcrash.py | application crashed [@ js::gc::GCRuntime::init]
[task 2019-03-22T04:30:56.466Z] Crash dump filename: /tmp/ed98e438-3d2f-4b28-1b6e32b7-8104aec8.dmp
[task 2019-03-22T04:30:56.466Z] Operating system: Linux
[task 2019-03-22T04:30:56.466Z] 0.0.0 Linux 4.4.0-1014-aws #14taskcluster1-Ubuntu SMP Tue Apr 3 10:27:00 UTC 2018 x86_64
[task 2019-03-22T04:30:56.466Z] CPU: amd64
[task 2019-03-22T04:30:56.466Z] family 6 model 63 stepping 2
[task 2019-03-22T04:30:56.466Z] 16 CPUs
[task 2019-03-22T04:30:56.466Z]
[task 2019-03-22T04:30:56.466Z] GPU: UNKNOWN
[task 2019-03-22T04:30:56.466Z]
[task 2019-03-22T04:30:56.466Z] Crash reason: SIGSEGV
[task 2019-03-22T04:30:56.466Z] Crash address: 0x0
[task 2019-03-22T04:30:56.466Z] Process uptime: not available
[task 2019-03-22T04:30:56.466Z]
[task 2019-03-22T04:30:56.466Z] Thread 0 (crashed)
[task 2019-03-22T04:30:56.467Z] 0 jsapi-tests!js::gc::GCRuntime::init [GC.cpp:d1e0b848dfcaf4387201fa2807eb807279f369e0 : 1264 + 0x0]
[task 2019-03-22T04:30:56.467Z] rax = 0x0000555557cd8800 rdx = 0x0000000000000000
[task 2019-03-22T04:30:56.467Z] rcx = 0x0000555556d30388 rbx = 0x00007ffff4ff96b8
[task 2019-03-22T04:30:56.467Z] rsi = 0x0000000000000000 rdi = 0x00007ffff70df880
[task 2019-03-22T04:30:56.467Z] rbp = 0x00007fffffffdf90 rsp = 0x00007fffffffdf10
[task 2019-03-22T04:30:56.467Z] r8 = 0x00007ffff7e00ca0 r9 = 0x0000000000000001
[task 2019-03-22T04:30:56.467Z] r10 = 0x0000000000000000 r11 = 0x00007ffff6dbeea0
[task 2019-03-22T04:30:56.467Z] r12 = 0x00007fffffffdf30 r13 = 0x0000000000100001
[task 2019-03-22T04:30:56.467Z] r14 = 0x0000000000020000 r15 = 0x0000000000020000
[task 2019-03-22T04:30:56.467Z] rip = 0x00005555560afce9
[task 2019-03-22T04:30:56.467Z] Found by: given as instruction pointer in context
[task 2019-03-22T04:30:56.467Z] 1 jsapi-tests!JSRuntime::init [Runtime.cpp:d1e0b848dfcaf4387201fa2807eb807279f369e0 : 206 + 0x12]
[task 2019-03-22T04:30:56.467Z] rbp = 0x00007fffffffe000 rsp = 0x00007fffffffdfa0
[task 2019-03-22T04:30:56.467Z] rip = 0x0000555555dd53c5
[task 2019-03-22T04:30:56.467Z] Found by: previous frame's frame pointer
[task 2019-03-22T04:30:56.467Z] 2 jsapi-tests!js::NewContext [JSContext.cpp:d1e0b848dfcaf4387201fa2807eb807279f369e0 : 159 + 0x11]
[task 2019-03-22T04:30:56.467Z] rbp = 0x00007fffffffe050 rsp = 0x00007fffffffe010
[task 2019-03-22T04:30:56.467Z] rip = 0x0000555555d08006
[task 2019-03-22T04:30:56.467Z] Found by: previous frame's frame pointer
[task 2019-03-22T04:30:56.467Z] 3 jsapi-tests!cls_testGCOutOfMemory::createContext [testGCOutOfMemory.cpp:d1e0b848dfcaf4387201fa2807eb807279f369e0 : 61 + 0x5]
[task 2019-03-22T04:30:56.467Z] rbp = 0x00007fffffffe070 rsp = 0x00007fffffffe060
[task 2019-03-22T04:30:56.467Z] rip = 0x0000555555815a3a
[task 2019-03-22T04:30:56.467Z] Found by: previous frame's frame pointer
[task 2019-03-22T04:30:56.467Z] 4 jsapi-tests!JSAPITest::init [tests.cpp:d1e0b848dfcaf4387201fa2807eb807279f369e0 : 18 + 0x2]
[task 2019-03-22T04:30:56.467Z] rbp = 0x00007fffffffe090 rsp = 0x00007fffffffe080
[task 2019-03-22T04:30:56.467Z] rip = 0x0000555555989a52
[task 2019-03-22T04:30:56.467Z] Found by: previous frame's frame pointer
[task 2019-03-22T04:30:56.467Z] 5 jsapi-tests!main [tests.cpp:d1e0b848dfcaf4387201fa2807eb807279f369e0 : 123 + 0x9]
[task 2019-03-22T04:30:56.467Z] rbp = 0x00007fffffffe110 rsp = 0x00007fffffffe0a0
[task 2019-03-22T04:30:56.467Z] rip = 0x000055555573b3a0
[task 2019-03-22T04:30:56.467Z] Found by: previous frame's frame pointer
[task 2019-03-22T04:30:56.467Z] 6 jsapi-tests!_GLOBAL__sub_I_WasmStubs.cpp [RegisterSets.h:d1e0b848dfcaf4387201fa2807eb807279f369e0 : 339 + 0x5]
[task 2019-03-22T04:30:56.467Z] rbp = 0x00007fffffffe110 rsp = 0x00007fffffffe0c0
[task 2019-03-22T04:30:56.467Z] rip = 0x000055555573d228
[task 2019-03-22T04:30:56.467Z] Found by: stack scanning
[task 2019-03-22T04:30:56.467Z] 7 libc-2.13.so + 0xfc48
[task 2019-03-22T04:30:56.467Z] rbp = 0x00007fffffffe110 rsp = 0x00007fffffffe0e8
[task 2019-03-22T04:30:56.467Z] rip = 0x00007ffff6d67c48
[task 2019-03-22T04:30:56.467Z] Found by: stack scanning
[task 2019-03-22T04:30:56.467Z] 8 libc-2.13.so + 0x1eead
[task 2019-03-22T04:30:56.467Z] rsp = 0x00007fffffffe120 rip = 0x00007ffff6d76ead
[task 2019-03-22T04:30:56.467Z] Found by: stack scanning
[task 2019-03-22T04:30:56.467Z] 9 jsapi-tests + 0x1e72b0
[task 2019-03-22T04:30:56.467Z] rsp = 0x00007fffffffe140 rip = 0x000055555573b2b0
[task 2019-03-22T04:30:56.467Z] Found by: stack scanning

Flags: needinfo?(pbone)
Attachment #9047645 - Attachment description: Bug 1531626 - (part 5) Introduce a GC_MIN_NURSERY_BYTES parameter r=jonco! → Bug 1531626 - (part 6) Introduce a GC_MIN_NURSERY_BYTES parameter r=jonco!

The problem was the value used in this jsapi-test for the maximum nursery size, was smaller than the minimum and caused an assertion. A new patch (part 4) fixes this.

Flags: needinfo?(pbone)

I mean part 5.

Pushed by pbone@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/01438c32f0ec
(part 1) Add missing keys to GCRuntime::getParameter() r=jonco
https://hg.mozilla.org/integration/autoland/rev/320e7ff05a60
(part 2) Refactor Nursery::maybeResizeNursery r=jonco
https://hg.mozilla.org/integration/autoland/rev/b0f8ca7dd5c8
(part 3) Include chunk trailers in nursery capacity r=jonco
https://hg.mozilla.org/integration/autoland/rev/8aaeb14dfc0c
(part 4) Always round-nearest for nursery size r=jonco
https://hg.mozilla.org/integration/autoland/rev/8a86b9e77fca
(part 5) Use a sensible maximum nursery size in a test r=arai
https://hg.mozilla.org/integration/autoland/rev/8a86347f3fd6
(part 6) Introduce a GC_MIN_NURSERY_BYTES parameter r=jonco

Thanks Noemi, that's was the same problem/cause, but I appreciate the message.

Regressions: 1540670
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: