Closed
Bug 944665
Opened 11 years ago
Closed 11 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)
(deleted),
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
(deleted),
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•11 years ago
|
||
Assignee: nobody → pwang
Attachment #8340316 -
Flags: feedback?(cyu)
Comment 2•11 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•11 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•11 years ago
|
blocking-b2g: --- → 1.3?
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #8340316 -
Attachment is obsolete: true
Assignee | ||
Comment 5•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Attachment #8341013 -
Flags: review?(khuey)
Assignee | ||
Updated•11 years ago
|
Attachment #8341014 -
Flags: review?(khuey)
Assignee | ||
Comment 6•11 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•11 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•11 years ago
|
||
Comment 12•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9275a2efc9e3
https://hg.mozilla.org/mozilla-central/rev/a21b57c78253
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Comment 13•11 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•11 years ago
|
||
Comment 15•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/da8c926f7e4d
https://hg.mozilla.org/mozilla-central/rev/e6b52f9d4138
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Comment 17•11 years ago
|
||
Updated•11 years ago
|
status-b2g-v1.3:
--- → fixed
Updated•11 years ago
|
Whiteboard: [tarako]
Updated•11 years ago
|
Whiteboard: [tarako] → [tarako][qa-]
Updated•11 years ago
|
status-b2g-v1.3T:
--- → fixed
Comment 18•11 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
•