Closed Bug 1623609 Opened 5 years ago Closed 7 days ago

Massive hangs waiting for processes creation on 2012 MacBook Pro

Categories

(Core :: IPC, defect, P3)

defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: emilio, Unassigned)

References

Details

See profile: https://perfht.ml/2wbidoE

Nightly is pretty snappy, but sometimes tab-switching just beachballs, and I managed to catch one of these on a profile.

I don't know how actionable this is... Maybe process creation should be async?

Fission has support for this, at least for subframes; see bug 1602712 and connected bugs. I don't know if that works for top-level documents yet.

There's also a content process that's launched asynchronously when the browser is idle, which usually satisfies a new tab's request for non-Fission; it doesn't work with Fission yet (I think?) but it eventually will.

But it's bad that launch is taking 8 seconds. It would help to add IPC Launch and maybe also Gecko_IOThread to the profiler's thread filter list and try to reproduce the hang again.

See Also: → 1602712

Ok, I'll try.

Flags: needinfo?(emilio)

Nika confirms that Fission process launching is async, but normal/e10s process launching is still synchronous.

Nika recommends duping this bug to async process launching bug 1602441. We intend to fix that bug before we ship Fission.

Emilio, since it looks like you intend to debug some more, I'll let you choose whether or when to dupe this bug to bug 1602441.

Blocks: 1602441

Not quite the same, but I think this process launch timed out and writing the minidump hung up the main thread: https://perfht.ml/2wq5hen just for reference.

This is what Jed was looking for I think: https://perfht.ml/2QxPjGe

It seems the IPC launch is spending a lot of time just waiting on mach_msg_trap... Jed do you see anything interesting there?

Flags: needinfo?(emilio) → needinfo?(jld)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)

Not quite the same, but I think this process launch timed out and writing the minidump hung up the main thread: https://perfht.ml/2wq5hen just for reference.

Also, Gabriele, maybe all the main thread IO in the profile here should also move to another thread? Is there a bug for that? If so I'd be happy to poke.

Flags: needinfo?(gsvelto)

We tried moving this OMT but it regressed badly so we gave up on that. The slowness here might be due to bug 1622316 for which I have a fix for waiting for review. That being said all this code is moving completely out-of-process in bug 1588530 which I'm currently working on.

Flags: needinfo?(gsvelto)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #5)

This is what Jed was looking for I think: https://perfht.ml/2QxPjGe

It seems the IPC launch is spending a lot of time just waiting on mach_msg_trap... Jed do you see anything interesting there?

The launch thread is blocked waiting for the child process to start up enough to send it Mach ports. We'd need an OS-level profiler to find out anything else, unfortunately.

Flags: needinfo?(jld)

Moving to IPC component

Unlinking unrelated async process launching bug 1602441

No longer blocks: 1602441
Component: DOM: Content Processes → IPC
Assignee: nobody → haftandilian
Priority: -- → P2

Emilio, can you think of any specific things you're doing that might help us reproduce this? I've got a 2012 MacBook Pro I can test with. I haven't been able to reproduce it with basic browsing.

Do you have any Mac tracing or debugging tools running that might slow down new process creation? I noticed kdebug_trace calls in the main thread stacks. I don't know much about kdebug, but it is used by Activity Monitor and some other tracing tools.

Flags: needinfo?(emilio)

I was running top -o cpu on a terminal, but that is about it (plus that is after noticing the problem, to try to diagnose it).

Other than that, not really. This started to happen after a catalina update, and I mitigated it a bit by disabling spindump, which was spawning up and slowing things even more (but again, that's after seeing the problem).

Flags: needinfo?(emilio)
Depends on: 1637048
Severity: normal → S3
Assignee: haftandilian → nobody
Priority: P2 → P3

Emilio, did you ever see this problem / hang again when switching tabs?

Flags: needinfo?(emilio)

No, I don't have that machine anymore.

Flags: needinfo?(emilio)

Shall we then close the bug as incomplete or is it worth keeping it open?

Status: NEW → RESOLVED
Closed: 7 days ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.