Align ChunkInfo by inserting padding in Chunk

RESOLVED FIXED in mozilla10

Status

()

Core
JavaScript Engine
--
major
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

Trunk
mozilla10
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 568509 [details] [diff] [review]
v1

We get a 2% speedup on EarlyBoyer if ChunkInfo (hot all over the GC allocator paths) is not split across a cache line.  An easy and guaranteed effective way to do this is to just pad Chunk out to the full 1MiB allocation.  This makes ChunkInfo abut the end of the 1MiB allocation, rather than whereever the Arenas and ChunkBitmap happen to end.  Since GC Chunks are aligned at 1MiB address boundaries, this ensures that ChunkInfo is inside of a
cache line.
Attachment #568509 - Flags: review?(wmccloskey)
(Assignee)

Comment 1

6 years ago
Speedup under 32bit linux build (running on 64bit) is an incredibly modest 0.2%, so this appears to be isolated to 64bit builds.
Status: NEW → ASSIGNED
Comment on attachment 568509 [details] [diff] [review]
v1

Nice job. Can you change the assert after the definition of Chunk to read:

JS_STATIC_ASSERT(sizeof(Chunk) == GC_CHUNK_SIZE);

(instead of <=)?
Attachment #568509 - Flags: review?(wmccloskey) → review+
(Assignee)

Comment 3

6 years ago
Created attachment 568572 [details] [diff] [review]
v2: With review feedback.

Good catch!  I actually had this check my other patch but forgot about it, apparently.
Attachment #568509 - Attachment is obsolete: true
Attachment #568572 - Flags: checkin?(wmccloskey)
https://hg.mozilla.org/integration/mozilla-inbound/rev/107c99294be7
Target Milestone: --- → mozilla10
https://hg.mozilla.org/mozilla-central/rev/107c99294be7
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Attachment #568572 - Flags: checkin?(wmccloskey)
You need to log in before you can comment on or make changes to this bug.