Closed
Bug 944665
Opened 7 years ago
Closed 7 years ago
Call preload slow things after preallocated process is forked from Nuwa
Categories
(Core :: IPC, defect)
Tracking
()
People
(Reporter: kk1fff, Assigned: kk1fff)
References
Details
(Whiteboard: [qa-])
Attachments
(2 files, 2 obsolete files)
11.37 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
2.60 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
PreloadSlowThings is called before Nuwa freeze now. This function produces many asynchronous messages from parent to frozen Nuwa. For a short term solution, we can move the code of invoking PreloadSlowThings to the new process forked from Nuwa.
Assignee | ||
Comment 1•7 years ago
|
||
Assignee: nobody → pwang
Attachment #8340316 -
Flags: feedback?(cyu)
Comment 2•7 years ago
|
||
Comment on attachment 8340316 [details] [diff] [review] Proposed Patch >From 3318c7156999b60f35ec2c6acfedfd10034f279f Mon Sep 17 00:00:00 2001 >From: Patrick Wang <kk1fff@patrickz.net> >Date: Fri, 29 Nov 2013 17:28:54 +0800 >Subject: [PATCH 5/5] Move common initialization routine into a function and > invoke PreloadSlowThings after nuwa forked > >--- > dom/ipc/ContentChild.cpp | 27 ++++--- > dom/ipc/ContentParent.cpp | 188 ++++++++++++++++++++++++--------------------- > dom/ipc/ContentParent.h | 5 ++ > 3 files changed, 122 insertions(+), 98 deletions(-) > >diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp >index fd558e1..b55eb0f 100644 >--- a/dom/ipc/ContentChild.cpp >+++ b/dom/ipc/ContentChild.cpp >@@ -1362,17 +1351,31 @@ ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID, > mAppInfo.UAName.Assign(UAName); > // If we're part of the mozbrowser machinery, go ahead and start > // preloading things. We can only do this for mozbrowser because > // PreloadSlowThings() may set the docshell of the first TabChild > // inactive, and we can only safely restore it to active from > // BrowserElementChild.js. > if ((mIsForApp || mIsForBrowser) && > Preferences::GetBool("dom.ipc.processPrelaunch.enabled", false)) { >- PreloadSlowThings(); >+#ifdef MOZ_NUWA_PROCESS >+ if (IsNuwaProcess()) { >+ // Perform GC before freezing the Nuwa process to reduce memory usage. >+ ContentChild::GetSingleton()->RecvGarbageCollect(); >+ >+ MessageLoop::current()-> >+ PostTask(FROM_HERE, >+ NewRunnableFunction(OnFinishNuwaPreparation)); >+ } else { >+ // This is a forked process, do preloading here. >+ PreloadSlowThings(); >+ } >+#else // !MOZ_NUWA_PROCESS >+ PreloadSlowThings(); >+#endif > } > return true; > } > I will prefer if ((mIsForApp || mIsForBrowser) && Preferences::GetBool("dom.ipc.processPrelaunch.enabled", false) #ifdef MOZ_NUWA_PROCESS && !IsNuwaProcess() #endif ) { PreloadSlowThings(); } And also, posting a delayed task should be moved out of the if block.
Attachment #8340316 -
Flags: feedback?(cyu)
Assignee | ||
Comment 3•7 years ago
|
||
As discussion on bug 941466, this would be a short term solution to make Nuwa enabled on try server.
Blocks: 930282
Assignee | ||
Updated•7 years ago
|
blocking-b2g: --- → 1.3?
Assignee | ||
Comment 4•7 years ago
|
||
Attachment #8340316 -
Attachment is obsolete: true
Assignee | ||
Comment 5•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Attachment #8341013 -
Flags: review?(khuey)
Assignee | ||
Updated•7 years ago
|
Attachment #8341014 -
Flags: review?(khuey)
Assignee | ||
Comment 6•7 years ago
|
||
Attachment #8341014 -
Attachment is obsolete: true
Attachment #8341014 -
Flags: review?(khuey)
Attachment #8341603 -
Flags: review?(khuey)
Have we measured how much this increases memory consumption (USS specifically) in the forked processes? Do we have a bug on file on undoing this and fixing it correctly?
Flags: needinfo?(pwang)
I guess those measurements are in bug 941466.
Flags: needinfo?(pwang)
Attachment #8341013 -
Flags: review?(khuey) → review+
Comment on attachment 8341603 [details] [diff] [review] Part 2: don't call PreloadSlowThings before nuwa fork. Review of attachment 8341603 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/ipc/ContentChild.cpp @@ +1363,5 @@ > PreloadSlowThings(); > } > + > +#ifdef MOZ_NUWA_PROCESS > + if (Preferences::GetBool("dom.ipc.processPrelaunch.enabled", false) && This is nit picky, but I would move this up further and do if (!Preferences::GetBool(...)) { return true; } if ((mIsForApp .... ... #ifdef MOZ_NUWA_PROCESS ...
Attachment #8341603 -
Flags: review?(khuey) → review+
Assignee | ||
Comment 10•7 years ago
|
||
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #8) > I guess those measurements are in bug 941466. Yes, they are. And bug 941466 is tracking the work for making the preloading work properly as well.
Assignee | ||
Comment 11•7 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/9275a2efc9e3 https://hg.mozilla.org/integration/b2g-inbound/rev/a21b57c78253
Comment 12•7 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9275a2efc9e3 https://hg.mozilla.org/mozilla-central/rev/a21b57c78253
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Comment 13•7 years ago
|
||
Backed out in https://hg.mozilla.org/mozilla-central/rev/06b3a7aea2c0 for frequent (somewhere between 20 and 50%) xpcshell shutdown crashes like https://tbpl.mozilla.org/php/getParsedLog.php?id=31651189&tree=B2g-Inbound
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla28 → ---
Assignee | ||
Comment 14•7 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/da8c926f7e4d https://hg.mozilla.org/integration/b2g-inbound/rev/e6b52f9d4138
Comment 15•7 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/da8c926f7e4d https://hg.mozilla.org/mozilla-central/rev/e6b52f9d4138
Status: REOPENED → RESOLVED
Closed: 7 years ago → 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Comment 17•7 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/2e63dfbf3661 https://hg.mozilla.org/releases/mozilla-aurora/rev/252715dcde18
Updated•7 years ago
|
status-b2g-v1.3:
--- → fixed
Updated•7 years ago
|
Whiteboard: [tarako]
Updated•7 years ago
|
Whiteboard: [tarako] → [tarako][qa-]
Updated•7 years ago
|
status-b2g-v1.3T:
--- → fixed
Comment 18•7 years ago
|
||
status-b2g-v1.3T: fixed indicated that its in tarako. remove [tarako] whiteboard
Whiteboard: [tarako][qa-] → [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•