Closed Bug 1024805 Opened 11 years ago Closed 11 years ago

Use tagged anonymous memory for Nuwa thread stacks

Categories

(Core :: DOM: Content Processes, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: jld, Assigned: jld)

References

Details

Attachments

(1 file)

Currently we malloc() Nuwa thread stacks, meaning that the entire virtual memory area containing the stack — and probably a lot of unrelated malloc'ed data — is marked as being the stack of one of the threads in question in procfs maps files. Also currently, we consider thread stacks as untagged anonymous memory in the system memory reporter, meaning that a bunch of the jemalloc heap will be misreported after bug 1011350 lands. (The name is available in that case, but I didn't want to complicate the parser to extract it when we could fix this problem directly instead.) If we mmap Nuwa stacks directly with the tagged anonymous memory functionality from bug 1011350, then this can't happen: a thread stack can't be merged with anything else (it has a different tag), and the guard page (different protection) prevents two adjacent stacks from being merged. Regular thread stacks aren't quite there unless/until we patch bionic (which already has an internal interface to PR_SET_VMA_ANON_NAME, and uses it for its own malloc), but empirically these stacks seem to be followed by jemalloc or something else that isn't also r/w and untagged and anonymous. So, with this fixed we might be able to (if tagged anonymous memory is supported) report non-main thread stacks as such. It would even be possible to obtain the thread name (probably make sense only for Gecko processes) from procfs.
Component: IPC → DOM: Content Processes
Trying: https://tbpl.mozilla.org/?tree=Try&rev=bf8c703c7b5d Also tested locally on Flame.
Attachment #8442518 - Flags: review?(khuey)
Attachment #8442518 - Flags: feedback?(cyu)
Comment on attachment 8442518 [details] [diff] [review] bug1024805-nuwa-named-stacks-hg0.diff Review of attachment 8442518 [details] [diff] [review]: ----------------------------------------------------------------- Also thanks for the bonus fixes :)
Attachment #8442518 - Flags: feedback?(cyu) → feedback+
The oranges on the try run in comment #1 seem to not be my fault.
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: