Open Bug 958566 Opened 10 years ago Updated 2 years ago

gfxFontCache::WordCacheExpirationTimerCallback causes activity during idle

Categories

(Core :: Graphics: Text, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: rvitillo, Unassigned)

References

Details

(Keywords: power, Whiteboard: [Power:P3])

Attachments

(1 file)

The timer is currently disabled in Release because of Bug 894798. In any case we should make sure that it doesn't fire during idle before it is re-enabled.
Blocks: 948528
Roberto, could you clarify in more detail what exactly the bug is here. Is it that the timer is firing in release? Or that the timer should be doing a better job of avoiding wakeups during idle, i.e. avoiding unnecessary work that causes power drain? The word cache uses nsExpirationTracker to dump shaped words but the text system uses this class in several other places to dump temporally cached data.  Seems like logic to avoid affecting power drain should happen there.
The timer is firing when FF is completely idle so it should be doing a better job at avoiding wakeups.
It should only wake up once and never again. Isn't that OK?
No, the timer is of type TYPE_REPEATING_SLACK and fires periodically every minute.
Ah, that's definitely bad. We should only enable it when the word cache is non-empty.
Whiteboard: [Power]
Assignee: nobody → jdaggett
(In reply to Roberto Agostino Vitillo (:rvitillo) from comment #0)

Roberto, I'd like to fix this. What set of steps are you using to figure out when wakeups occur? I'd like to be able to confirm that fixing the timer logic fixes the wakeups problem.
Flags: needinfo?(rvitillo)
jdaggett, the last paragraph of
http://robertovitillo.com/2014/02/04/idle-wakeups-are-evil/ has an explanation.
I've been running a tweaked and updated version of the patch mentioned there,
which I've attached here.

It works on Mac. On Linux the blog post says you need to build with
-export-dynamic linker flag. I haven't tested this.
Assignee: jdaggett → n.nethercote
Status: NEW → ASSIGNED
Flags: needinfo?(rvitillo)
Assignee: n.nethercote → nobody
Status: ASSIGNED → NEW
Assignee: nobody → jdaggett
(In reply to Nicholas Nethercote [:njn] from comment #7)
> Created attachment 8658002 [details] [diff] [review]
> (DO NOT LAND) Add dd hoc profiling of timer firing

This code is now in the tree, and is documented here: https://developer.mozilla.org/en-US/docs/Mozilla/Performance/TimerFirings_logging

jdaggett, it should help you a lot with this bug.
Whiteboard: [Power] → [Power:P3]
Assignee: jd.bugzilla → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: