Closed Bug 1686035 Opened 4 years ago Closed 4 years ago

6.9% Heap Unclassified (windows10-64-shippable-qr) regression on push 899944ef4aa72a26a3de63d48f952213ec73b2b8 (Fri January 8 2021)

Categories

(Core :: Graphics: WebRender, defect)

defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox84 --- unaffected
firefox85 --- unaffected
firefox86 --- fixed

People

(Reporter: aesanu, Assigned: mstange)

References

(Regression)

Details

(Keywords: perf, perf-alert, regression)

Perfherder has detected a awsy performance regression from push 899944ef4aa72a26a3de63d48f952213ec73b2b8. As author of one of the patches included in that push, we need your help to address this regression.

Regressions:

Ratio Suite Test Platform Options Absolute values (old vs new)
7% Heap Unclassified windows10-64-shippable-qr 53,682,679.12 -> 57,387,642.17

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests. Please follow our guide to handling regression bugs and let us know your plans within 3 business days, or the offending patch(es) will be backed out in accordance with our regression policy.

For more information on performance sheriffing please see our FAQ.

Flags: needinfo?(mstange.moz)

Maybe it's the following that I now see in the DMD report?

Unreported {
  524 blocks in heap block record 5 of 29,314
  4,292,608 bytes (2,301,408 requested / 1,991,200 slop)
  Individual block sizes: 8,192 x 524
  0.68% of the heap (12.06% cumulative)
  1.98% of unreported (34.96% cumulative)
  Allocated at {
    #01: SkTypeface_Mac::onCreateScalerContext(SkScalerContextEffects const&, SkDescriptor const*) const (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x1454629)
    #02: SkTypeface::createScalerContext(SkScalerContextEffects const&, SkDescriptor const*, bool) const (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x1479d7c)
    #03: SkStrikeCache::CreateScalerContext(SkDescriptor const&, SkScalerContextEffects const&, SkTypeface const&) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x4d2662c)
    #04: SkStrikeCache::findOrCreateStrike(SkDescriptor const&, SkScalerContextEffects const&, SkTypeface const&) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x148941c)
    #05: SkStrikeSpec::findOrCreateExclusiveStrike(SkStrikeCache*) const (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x1489987)
    #06: SkGlyphRunListPainter::drawForBitmapDevice(SkGlyphRunList const&, SkMatrix const&, SkGlyphRunListPainter::BitmapDevicePainter const*) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x4cfffab)
    #07: SkBitmapDevice::drawGlyphRunList(SkGlyphRunList const&) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x4c8d281)
    #08: SkGlyphRunBuilder::drawTextBlob(SkPaint const&, SkTextBlob const&, SkPoint, SkBaseDevice*) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x4cffd3a)
    #09: SkCanvas::onDrawTextBlob(SkTextBlob const*, float, float, SkPaint const&) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x4c968e6)
    #10: SkCanvas::drawTextBlob(SkTextBlob const*, float, float, SkPaint const&) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x4c96bff)
    #11: mozilla::gfx::DrawTargetSkia::DrawGlyphs(mozilla::gfx::ScaledFont*, mozilla::gfx::GlyphBuffer const&, mozilla::gfx::Pattern const&, mozilla::gfx::StrokeOptions const*, mozilla::gfx::DrawOptions const&) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x2c906cb)
    #12: mozilla::gfx::RecordedFillGlyphs::PlayEvent(mozilla::gfx::Translator*) const (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x2c9f711)
    #13: std::__1::__function::__func<mozilla::gfx::InlineTranslator::TranslateRecording(char*, unsigned long)::$_0, std::__1::allocator<mozilla::gfx::InlineTranslator::TranslateRecording(char*, unsigned long)::$_0>, bool (mozilla::gfx::RecordedEvent*)>::operator( (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x9feba3)
    #14: bool mozilla::gfx::RecordedEvent::DoWithEvent<mozilla::gfx::InlineTranslator::TranslateRecording(char*, unsigned long)::MemReader>(mozilla::gfx::InlineTranslator::TranslateRecording(char*, unsigned long)::MemReader&, mozilla::gfx::RecordedEvent::EventType (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x9fc768)
    #15: mozilla::gfx::InlineTranslator::TranslateRecording(char*, unsigned long) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x9fa88a)
    #16: mozilla::gfx::CrossProcessPaint::Start(mozilla::dom::WindowGlobalParent*, mozilla::dom::DOMRect const*, float, unsigned int, mozilla::gfx::CrossProcessPaintFlags, mozilla::dom::Promise*)::$_0::operator()(nsRefPtrHashtable<nsUint64HashKey, mozilla::gfx::Re (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x2eecbbe)
    #17: mozilla::MozPromise<nsRefPtrHashtable<nsUint64HashKey, mozilla::gfx::RecordedDependentSurface>, nsresult, true>::ThenValue<mozilla::gfx::CrossProcessPaint::Start(mozilla::dom::WindowGlobalParent*, mozilla::dom::DOMRect const*, float, unsigned int, mozilla (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x2eec8ab)
    #18: mozilla::MozPromise<nsRefPtrHashtable<nsUint64HashKey, mozilla::gfx::RecordedDependentSurface>, nsresult, true>::ThenValueBase::ResolveOrRejectRunnable::Run() (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x2eed66d)
    #19: mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x556f6e)
    #20: mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_4>::Run() (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x55b06c)
    #21: nsThread::ProcessNextEvent(bool, bool*) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x565c39)
    #22: NS_ProcessPendingEvents(nsIThread*, unsigned int) (/Applications/FirefoxNightly.app/Contents/MacOS/XUL + 0x56313c)
  }
}

I think it might be this one:

    #01: replace_realloc(void*, unsigned long) (/Applications/Firefox Nightly.app/Contents/MacOS/libmozglue.dylib + 0x2d2d4)
    #02: webrender::lru_cache::LRUCache$LT$T$C$M$GT$::push_new::he24d6eb3b6a3e89f (/Applications/Firefox Nightly.app/Contents/MacOS/XUL + 0x1e6536a)
    #03: webrender::texture_cache::TextureCache::update::h2fee3cd61aeb65e0 (/Applications/Firefox Nightly.app/Contents/MacOS/XUL + 0x1f3745f)
    #04: webrender::resource_cache::ResourceCache::block_until_all_resources_added::h7c7e641a46bb12d7 (/Applications/Firefox Nightly.app/Contents/MacOS/XUL + 0x1ef5220)
    #05: webrender::frame_builder::FrameBuilder::build::h67ad6e27ad9f578a (/Applications/Firefox Nightly.app/Contents/MacOS/XUL + 0x1e4cb36)
    #06: webrender::render_backend::Document::build_frame::hb80031bd93101de2 (/Applications/Firefox Nightly.app/Contents/MacOS/XUL + 0x1e99a1a)
    #07: webrender::render_backend::RenderBackend::update_document::h98b81bf6e8e06031 (/Applications/Firefox Nightly.app/Contents/MacOS/XUL + 0x1ea526a)

The patch caused more things to stay in the LRU cache. It didn't cause a change to how many blobs get rasterized, and comment 1 is a stack from blob rasterization.

Flags: needinfo?(mstange.moz)

The patch fixed a regression from bug 1679751. Did we see a similar decrease in heap-unclassified when bug 1679751 landed?

Assignee: nobody → mstange.moz
Status: NEW → ASSIGNED
Flags: needinfo?(aesanu)

(In reply to Markus Stange [:mstange] from comment #2)

#01: replace_realloc(void*, unsigned long) (/Applications/Firefox Nightly.app/Contents/MacOS/libmozglue.dylib + 0x2d2d4)
#02: webrender::lru_cache::LRUCache$LT$T$C$M$GT$::push_new::he24d6eb3b6a3e89f (/Applications/Firefox Nightly.app/Contents/MacOS/XUL + 0x1e6536a)

The patch caused more things to stay in the LRU cache. It didn't cause a change to how many blobs get rasterized, and comment 1 is a stack from blob rasterization.

So you are saying that it's now all correctly reported under LRU since bug 1684812 landed on autoland? At least that would be a sign for the recent drop, which is a bit larger than the reported regression:

https://treeherder.mozilla.org/perfherder/graphs?highlightAlerts=1&highlightChangelogData=1&series=autoland,1959227,1,4&timerange=1209600&zoom=1610051465495,1610374220987,49256100.19179262,61499438.15204001

Oh, thanks for the pointer to bug 1684812! I almost went ahead to write that same patch...
Awesome, I think that indeed fixed this heap-unclassified regression.

To be clear, an increase in memory usage was expected from bug 1685643, because it fixed a bug where we were freeing too much too quickly and where we would prefer to cache more. What wasn't expected was that the extra memory usage went into heap-unclassified, and that's what bug 1684812 fixes.

Depends on: 1684812

Set release status flags based on info from the regressing bug 1685643

Clearing need info since the cause of the bug was found.

Flags: needinfo?(aesanu)

Fixed by bug 1684812.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.