Closed
Bug 517083
Opened 15 years ago
Closed 15 years ago
TM: introduce a temp allocator for allocations during recording and compilation
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.2 | --- | beta1-fixed |
People
(Reporter: gal, Assigned: graydon)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(2 files, 1 obsolete file)
28.72 KB,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
6.85 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
This will reduce memory pressure on the long-lived code and data allocator.
Reporter | ||
Comment 1•15 years ago
|
||
Assignee: general → gal
Reporter | ||
Updated•15 years ago
|
Attachment #401120 -
Attachment is patch: true
Attachment #401120 -
Attachment mime type: application/octet-stream → text/plain
Reporter | ||
Comment 2•15 years ago
|
||
This patch introduces tempAllocs for regexp and the tracer, but doesn't actually use it yet. It had some memory corruption with the full patch, so I was trying to move over separate parts step by step from dataAlloc to tempAlloc.
Assignee | ||
Updated•15 years ago
|
Assignee: gal → graydon
Assignee | ||
Comment 3•15 years ago
|
||
This patch rebases, fixes the memory error (it was tiny) and commences using the tempAlloc for a few minor cases. Passes all tests.
I'd prefer to name these monAlloc and recAlloc, to more plainly identify the lifetimes they're associated with (monitor lifetime and recorder lifetime). If you concur, I'll change that before landing. Or suggest a similarly clear name. I don't think "dataAlloc" really expresses much more than "allocator".
Note that we can't *quite* move LIR into recAlloc just yet, but after a couple other bits of work it should be ready. I'll follow through that work on bug 497009 and bug 513276.
Attachment #401120 -
Attachment is obsolete: true
Attachment #402160 -
Flags: review?(gal)
Reporter | ||
Comment 4•15 years ago
|
||
Thanks for picking up my slack here graydon.
I like dataAlloc because it holds data associated with the code cache, which is codeAlloc. Both dataAlloc and codeAlloc have the same lifetime (long lived).
Separate of that I would propose lirAlloc, which then can be long lived or short lived, depending on whether we have recompilation or not (not yet, so it lives with the recorder soon).
Assignee | ||
Comment 5•15 years ago
|
||
(In reply to comment #4)
> Thanks for picking up my slack here graydon.
eh? it's assigned to me now :)
> I like dataAlloc because it holds data associated with the code cache, which is
> codeAlloc. Both dataAlloc and codeAlloc have the same lifetime (long lived).
Ok. Is that an r+ then?
> Separate of that I would propose lirAlloc, which then can be long lived or
> short lived, depending on whether we have recompilation or not (not yet, so it
> lives with the recorder soon).
Already got the last of the skip()s moved out into allocators in wip patch, will be adding a liralloc shortly.
Reporter | ||
Updated•15 years ago
|
Attachment #402160 -
Flags: review?(gal) → review+
Reporter | ||
Comment 6•15 years ago
|
||
Comment on attachment 402160 [details] [diff] [review]
update
Reviewing a bunch of changes I did myself. There should be a rule against this but there isn't =)
Assignee | ||
Comment 7•15 years ago
|
||
Whiteboard: fixed-in-tracemonkey
Comment 8•15 years ago
|
||
This is a SunSpider regression on windows and linux.
Regression: Tp4 increase 0.97% on Linux TraceMonkey
Regression: SunSpider increase 1.17% on XP TraceMonkey
Assignee | ||
Comment 9•15 years ago
|
||
(In reply to comment #8)
> This is a SunSpider regression on windows and linux.
>
> Regression: Tp4 increase 0.97% on Linux TraceMonkey
> Regression: SunSpider increase 1.17% on XP TraceMonkey
Sigh. How talos manages to get a clear signal on linux, I will never know.
Thinking about this, I've a pretty good idea what's causing it (the mReserve part of the allocator; it'll cause TraceRecorder as a structure to grow by 64kb, until the day we have an actually-sane OOM-handler).
Sorry. Will fix once I'm in the office (move the temp alloc to the monitor, pass in a reference, reset when deleting recorder).
Assignee | ||
Comment 10•15 years ago
|
||
This moves the temp allocators up to the monitor and just *resets* them when the recorders die. Avoids rapid reallocation of the 64kb temp space.
It's a bit of a kludge, but we can remove it if and when we determine a less ghastly OOM handler. Meanwhile it appears to undo the performance regression on the machines I can measure with here.
Attachment #402420 -
Flags: review?(gal)
Assignee | ||
Updated•15 years ago
|
Attachment #402420 -
Flags: review?(gal) → review?(dvander)
Updated•15 years ago
|
Attachment #402420 -
Flags: review?(dvander) → review+
Assignee | ||
Comment 11•15 years ago
|
||
Reporter | ||
Comment 12•15 years ago
|
||
Comment on attachment 402420 [details] [diff] [review]
fix the regresssion
>
>- CLS(VMAllocator) dataAlloc; // A chunk allocator for LIR.
>- CLS(nanojit::CodeAlloc) codeAlloc; // A general allocator for native code.
>+ CLS(VMAllocator) dataAlloc; /* A chunk allocator for LIR. */
>+ CLS(VMAllocator) tempAlloc; /* A temporary chunk allocator. */
>+ CLS(nanojit::CodeAlloc) codeAlloc; /* An allocator for native code. */
Uber-nit: order should be code, data, temp imo.
>+
>+ ~RegExpNativeCompiler() {
>+ /* Purge the tempAlloc used during recording. */
>+ tempAlloc.reset();
>+ }
And now you know why I added reset() =)
Comment 13•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 14•15 years ago
|
||
this could help fix some perf problems, and it's been stable, so taking on 192.
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/62b03aeedfa9
status1.9.2:
--- → beta1-fixed
Flags: wanted1.9.2+
Comment 15•15 years ago
|
||
perf regression fix:
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/abf2f44642c1
Assignee | ||
Updated•15 years ago
|
Flags: in-testsuite-
You need to log in
before you can comment on or make changes to this bug.
Description
•