Bug 1331861

Summary: [SHA256_Compress] CPU usage goes from ~17% to 80-150% when downloading files
Product: [Fedora] Fedora Reporter: Chris Murphy <bugzilla>
Component: firefoxAssignee: Martin Stransky <stransky>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: gecko-bugs-nobody, jhorak, pjasicek, stransky
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-02 19:58:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Chris Murphy 2016-04-29 20:42:25 UTC
Description of problem:

When I click on a file to download, e.g. a Fedora installation image ISO, Firefox CPU load goes from the 10-20% range to 80+% topping out at 150% until the download is finished and then it goes back to 10-20%.

Version-Release number of selected component (if applicable):
firefox-45.0.2-1.fc23.x86_64


How reproducible:
Always, does not appear to be a regression


Steps to Reproduce:
1. Run top
2. Launch Firefox, note CPU usage
3. Start a file download, note CPU usage
4. Wait for it to finish or cancel the download, note CPU usage

Actual results:

Huge increase in CPU consumption only when downloading.

Expected results:

This shouldn't use much more CPU than using curl or wget.

Additional info:

I get the same results with a Mozilla tarball of Firefox.

I'm not sure what information to include to track this down. 'strace -p -ff -o' or maybe attach gdb, but I'm not sure exactly what to do there at all, but if I get some guidance I'll provide what I can.

Comment 1 Martin Stransky 2016-05-02 10:18:17 UTC
Yes, I can reproduce it. It really takes so much CPU.

Comment 2 Martin Stransky 2016-05-02 19:49:33 UTC
Looks like it's eaten by SHA256_Compress() which encrypt IPC communication between child download process and main firefox process. The load may depends on the actual download speed - bigger download volume may produce higher load.

Comment 3 Martin Stransky 2016-05-02 19:58:53 UTC
Let's track it upstream - https://bugzilla.mozilla.org/show_bug.cgi?id=1246558