Closed Bug 1690104 Opened 5 years ago Closed 4 years ago

New main thread hangs in RtlQueryPerformanceCounter / TimeStamp::Now()

Categories

(Core :: Performance: General, defect)

All
Windows
defect

Tracking

()

RESOLVED WORKSFORME
Performance Impact ?
Tracking Status
firefox-esr78 --- unaffected
firefox85 --- unaffected
firefox86 --- unaffected
firefox87 --- affected

People

(Reporter: mstange, Unassigned)

References

(Regression)

Details

(Keywords: regression)

The BHR dashboard at https://fqueze.github.io/hang-stats/ is showing a new hang on Windows that wasn't there before: A lot of time is spent getting timestamps using RtlQueryPerformanceCounter under JS::UnmarkGrayGCThingRecursively (called from EventListenerManager::MarkForCC).

Jon, is it possible that the patch in bug 1689140 caused us to query the current timestamp more frequently than before?

Flags: needinfo?(jcoppeard)

JS::UnmarkGrayGCThingRecursively doesn't use SliceBudget so that's unlikely. I don't know why this would have changed.

Unfortunately the BHR dashboard isn't working at the moment. Do you have any idea when this started happening?

Flags: needinfo?(jcoppeard)

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

Flags: needinfo?(mstange.moz)

Florian, can you find out when this started?

Flags: needinfo?(mstange.moz) → needinfo?(florian)

The full stack is:

    RtlQueryPerformanceCounter ntdll
    static mozilla::TimeStamp::NowUnfuzzed(bool) mozglue
    JS::UnmarkGrayGCThingRecursively(JS::GCCellPtr) xul
    static mozilla::dom::FragmentOrElement::CanSkip(nsINode*, bool) xul
    mozilla::CycleCollectedJSRuntime::UnmarkSkippableJSHolders() xul
    nsCCUncollectableMarker::Observe(nsISupports*, char const*, char16_t const*) xul
    nsObserverList::NotifyObservers(nsISupports*, char const*, char16_t const*) xul
    nsObserverService::NotifyObservers(nsISupports*, char const*, char16_t const*) xul
    nsObserverService::NotifyObservers cycle-collector-forget-skippable
    XPCJSRuntime::PrepareForForgetSkippable() xul
    nsCycleCollector_forgetSkippable(js::SliceBudget&, bool, bool) xul
    nsCycleCollector_forgetSkippable
    FireForgetSkippable(bool, mozilla::TimeStamp) xul
    CCRunnerFired(mozilla::TimeStamp) xul
    virtual bool std::_Func_impl_no_alloc<bool ( *)(class mozilla::TimeStamp),bool,class mozilla::TimeStamp>::_Do_call(class mozilla::TimeStamp &&) xul
    mozilla::IdleTaskRunner::Run() xul
    mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex &> const&) xul

JS::UnmarkGrayGCThingRecursively does result in a call to RtlQueryPerformanceCounter and always has. Maybe something has made the forgetSkippable happen more often?

Flags: needinfo?(continuation)

Is it possible that the stack changed somehow? I'm not aware of anything that would have made us do forget skippable more often.

Olli, have their been any idle scheduling changes that might affect this?

Failing that, we might want to look at general cycle collector or ghost window metrics to see if anything regressed there. It could be a symptom of leaks which tend to tank CC performance.

Flags: needinfo?(continuation)

Hmm, do we have still the old bhr UI available? I think using that it was easy(er) to see regressions.

I'm not aware of changes to idle handling, unless pbone's patches have already landed.

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

Florian, can you find out when this started?

The frequency is very low in current data: https://fqueze.github.io/hang-stats/#row=0&filter=NowUnfuzzed (20210213).

Do we still care about finding out when this started, or can we resolve as worksforme?

(In reply to Olli Pettay [:smaug] from comment #7)

Hmm, do we have still the old bhr UI available?

We still have the code at https://github.com/squarewave/bhr.html but the arewesmoothyet domain name has expired.

^ (trying to clear up some release engineering triage)

Flags: needinfo?(mstange.moz)

(In reply to Florian Quèze [:florian] from comment #8)

The frequency is very low in current data: https://fqueze.github.io/hang-stats/#row=0&filter=NowUnfuzzed (20210213).

Ok, then let's close this bug.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(mstange.moz)
Flags: needinfo?(florian)
Resolution: --- → WORKSFORME
Has Regression Range: --- → yes
Performance Impact: --- → ?
Whiteboard: [qf]
You need to log in before you can comment on or make changes to this bug.