Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Issue 148443006: Linux: tear down Zygote at browser shutdown. (Closed)

Created:
6 years, 11 months ago by jln (very slow on Chromium)
Modified:
6 years, 10 months ago
Reviewers:
piman
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, Mark Seaborn
Visibility:
Public.

Description

Linux: tear down Zygote at browser shutdown. In BrowserMainLoop::ShutdownThreadsAndCleanUp(), we explicitly call a new ZygoteHostImpl::TearDownAfterLastChild API to notify the Zygote to exit after its last child died. The notification is to simply close the IPC channel to the Zygote. Before this patch, this would happen implicitly when the browser process died. To implement this, we add a lightweight child tracking mechanism to ZygoteHostImpl. BUG=334345 R=piman@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247572

Patch Set 1 #

Total comments: 2

Patch Set 2 : Implement process tracking. #

Patch Set 3 : Use tmp_status. #

Patch Set 4 : Add child_tracking_lock_ #

Patch Set 5 : Don't reset init_. Rely on control_fd_ for DCHECKs. #

Total comments: 2

Patch Set 6 : Don't call TearDown() while holding child_tracking_lock_. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -22 lines) Patch
M content/browser/browser_main_loop.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/zygote_host/zygote_host_impl_linux.h View 1 2 3 4 chunks +19 lines, -0 lines 0 comments Download
M content/browser/zygote_host/zygote_host_impl_linux.cc View 1 2 3 4 5 7 chunks +78 lines, -22 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
jln (very slow on Chromium)
Antoine, PTAL! I need to watch NaCl in the try bots. I wonder if some ...
6 years, 11 months ago (2014-01-28 00:18:45 UTC) #1
jln (very slow on Chromium)
It looks like this simplistic approach won't work. Out of process plugins hosts can still ...
6 years, 11 months ago (2014-01-28 00:59:37 UTC) #2
jln (very slow on Chromium)
Still looking into this: I did implement process tracking in ZygoteHostImpl and there are a ...
6 years, 11 months ago (2014-01-28 02:13:01 UTC) #3
piman
https://codereview.chromium.org/148443006/diff/1/content/browser/zygote_host/zygote_host_impl_linux.cc File content/browser/zygote_host/zygote_host_impl_linux.cc (right): https://codereview.chromium.org/148443006/diff/1/content/browser/zygote_host/zygote_host_impl_linux.cc#newcode226 content/browser/zygote_host/zygote_host_impl_linux.cc:226: } nit: maybe reset control_fd_ to -1 for added ...
6 years, 11 months ago (2014-01-28 02:20:44 UTC) #4
jln (very slow on Chromium)
So, it turns out that in the SIGTERM (or "browser close button") case child of ...
6 years, 11 months ago (2014-01-28 02:52:45 UTC) #5
piman
LGTM
6 years, 11 months ago (2014-01-28 03:46:49 UTC) #6
jln (very slow on Chromium)
Antoine: do you mind taking another quick look? I added a lock around the child ...
6 years, 10 months ago (2014-01-28 21:42:25 UTC) #7
piman
https://chromiumcodereview.appspot.com/148443006/diff/110001/content/browser/zygote_host/zygote_host_impl_linux.cc File content/browser/zygote_host/zygote_host_impl_linux.cc (right): https://chromiumcodereview.appspot.com/148443006/diff/110001/content/browser/zygote_host/zygote_host_impl_linux.cc#newcode226 content/browser/zygote_host/zygote_host_impl_linux.cc:226: TearDown(); Can we release the lock before calling TearDown? ...
6 years, 10 months ago (2014-01-28 22:38:31 UTC) #8
jln (very slow on Chromium)
Thanks, ptal! https://chromiumcodereview.appspot.com/148443006/diff/110001/content/browser/zygote_host/zygote_host_impl_linux.cc File content/browser/zygote_host/zygote_host_impl_linux.cc (right): https://chromiumcodereview.appspot.com/148443006/diff/110001/content/browser/zygote_host/zygote_host_impl_linux.cc#newcode226 content/browser/zygote_host/zygote_host_impl_linux.cc:226: TearDown(); On 2014/01/28 22:38:32, piman wrote: [...] ...
6 years, 10 months ago (2014-01-28 23:22:11 UTC) #9
piman
lgtm
6 years, 10 months ago (2014-01-28 23:25:21 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jln@chromium.org/148443006/130001
6 years, 10 months ago (2014-01-29 00:06:55 UTC) #11
jln (very slow on Chromium)
Committed patchset #6 manually as r247572 (presubmit successful).
6 years, 10 months ago (2014-01-29 01:37:59 UTC) #12
commit-bot: I haz the power
6 years, 10 months ago (2014-01-29 01:38:49 UTC) #13
Message was sent while issue was closed.
CQ bit was unchecked on CL. Ignoring.

Powered by Google App Engine
This is Rietveld 408576698