Closed Bug 1714069 Opened 3 years ago Closed 3 years ago

Degraded performance after upgrading to Firefox 89 on Linux

Categories

(Core :: Graphics: WebRender, defect)

Firefox 89
defect

Tracking

()

VERIFIED FIXED
91 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox89 + disabled
firefox90 + verified
firefox91 --- verified

People

(Reporter: firefoxbugs, Assigned: rmader)

References

(Regressed 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0

Steps to reproduce:

FIrefox is using significantly more CPU after upgrading from Firefox 88 to 89. The increased CPU is noticeable on loading any page, typing into the address bar, and typing into a text box like this bug report.

Actual results:

As I type this, the main Firefox process is using over 100% of one CPU and the other Firefox processes are each using around 12%.

If I load https://www.ozbargain.com.au, the main process uses around 240% for several seconds, and the remaining processes around 25%.

Consequently my laptop is running hotter and the fan makes a lot of noise every time I load a new page.

Expected results:

Lower CPU. I will downgrade to Firefox 88 to try to get some comparative numbers.

After downgrading to Firefox 88.0.1, typing into a text box peaks at around 23% of one core and typically sits at around 10%.

Loading https://www.ozbargain.com.au, the main process peaks at around 75% and falls back to ~5% after one second.

Obviously this isn't very scientific but there is clearly a significant difference.

The Bugbug bot thinks this bug should belong to the 'Core::Performance' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Performance
Product: Firefox → Core

Hi Steve, If you can reproduce this reliably, can you try mozregression to find which revision caused the regression?

Flags: needinfo?(firefoxbugs)

I have run mozregression, which showed the problem started prior to Firefox 88. This surprises my because I have no issues with my 88.0.1 install (Gentoo distribution, firefox-bin package).

But in any case, it does identify the problematic commit.

11:20.96 INFO: Last good revision: 1c59701a68c9e52fcdc0bf02c02eb1dca962bc6f
11:20.96 INFO: First bad revision: c2a14298ecf313c001958c37d49cb5d9e6b7894a
11:20.96 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=1c59701a68c9e52fcdc0bf02c02eb1dca962bc6f&tochange=c2a14298ecf313c001958c37d49cb5d9e6b7894a

Flags: needinfo?(firefoxbugs)
Component: Performance → Graphics: WebRender
Regressed by: 1680512
Has Regression Range: --- → yes

Steve, can you post the graphics section of about:support?

Flags: needinfo?(firefoxbugs)
Summary: Degraded performance after upgrading to Firefox 89 → Degraded performance after upgrading to Firefox 89 on Linux

Ideally from 88 and 89

Flags: needinfo?(firefoxbugs)

Interesting. So in both cases llvmpipe is used instead of a hardware driver - is that intended? Does you setup not have any hardware GPU? What changed is that we don't detect llvmpipe as a software driver any more, thus running HW-WR on llvmpipe instead of SW-WR - the later being much more optimized for running on the CPU.

IIUC there're two places which we should fix:

I can reproduce this by using LIBGL_ALWAYS_SOFTWARE=1. Looks easy to fix.

Steve: you can work around this for the time being by setting gfx.webrender.software to true (or by fixing your setup in case you actually do have a GPU).

Assignee: nobody → robert.mader
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

I do have a GPU so clearly there is some issue with my setup. Setting gfx.webrender.software to true makes the performance go back to normal.

Thanks everyone!

We currently allow software drivers such as llvmpipe to run HW-WR -
in nightly and apparently even in release.
Explicitly make these drivers always use SW-WR instead.

While on it, improve our detection for software drivers in glxtest.
This may become handy for new software drivers such as zink+lavapipe.

Tracking for 89, I might take a safe patch in a dot release.

Pushed by robert.mader@posteo.de:
https://hg.mozilla.org/integration/autoland/rev/22f7bdbfbd92
Block Mesa software drivers for HW-WR, r=aosmond
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

Comment on attachment 9225062 [details]
Bug 1714069 - Block Mesa software drivers for HW-WR, r=aosmond

Beta/Release Uplift Approval Request

  • User impact if declined: A small set of users will have massively reduced performance. These may be relatively common cases such as virtual machines.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Start Firefox with LIBGL_ALWAYS_SOFTWARE=1 on Linux. Before this path, in some setups this will make us use "Webrender" instead of "Webrender (Software)". After this patch it should always use "Webrender (Software)" (or "Basic).
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The worst thing that can happen is that some devices use SW-WR instead of HW-WR. That implies a little performance drop, but doesn't make the browser unusable.
  • String changes made/needed:
Attachment #9225062 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Comment on attachment 9225062 [details]
Bug 1714069 - Block Mesa software drivers for HW-WR, r=aosmond

Beta/Release Uplift Approval Request

  • User impact if declined: A small set of users will have massively reduced performance. These may be relatively common cases such as virtual machines.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Start Firefox with LIBGL_ALWAYS_SOFTWARE=1 on Linux. Before this path, in some setups this will make us use "Webrender" instead of "Webrender (Software)". After this patch it should always use "Webrender (Software)" (or "Basic).
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The worst thing that can happen is that some devices use SW-WR instead of HW-WR. That implies a little performance drop, but doesn't make the browser unusable.
  • String changes made/needed:
Attachment #9225062 - Flags: approval-mozilla-release?

@Pascal: the worst case scenario has actually happened and some devices now fall back to SW-WR that shouldn't. A patch is coming in bug 1714897.

Regressions: 1714897
QA Whiteboard: [qa-triaged]

I followed the steps from comment 19 and after update to Fx89 there is no reduced performance. @Steve C, could you please retest this on Nightly 91 to see if the issue is fixed for you?

Flags: needinfo?(firefoxbugs)

Since I raised this issue I have fixed my environment so that hardware acceleration is working properly, and therefore I can only reproduce it by setting LIBGL_ALWAYS_SOFTWARE=1. With that environment variable I can reproduce the issue with Firefox 89 but not with Nightly 91.

Flags: needinfo?(firefoxbugs)

I will close this bug as verified fixed because Steve C confirms the fix on Nightly 91.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+

I'll hold off on the beta uplift until the issues with amdgpu and nvidia are sorted.

Attachment #9225062 - Flags: approval-mozilla-release?

Comment on attachment 9225062 [details]
Bug 1714069 - Block Mesa software drivers for HW-WR, r=aosmond

approved for 90.0b7

Attachment #9225062 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Steve, can you please verify if the issue is fixed for you on Firefox 90 as well?

Flags: needinfo?(firefoxbugs)

Looks good, I cannot reproduce the original issue with FIrefox 90.0b7.

Flags: needinfo?(firefoxbugs)

Thanks for looking into it, Steve!

See Also: → 1715902
Regressions: 1717843
Regressions: 1731480
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: