Closed Bug 1014398 Opened 10 years ago Closed 6 years ago

[Dolphin] Unnecessary loading of shared library in gralloc

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: pehrsons, Unassigned)

References

Details

(Whiteboard: [POVB])

Attachments

(1 file)

Here is a profile of a Dolphin running webrtc with one remote peer: http://firefoxos-public.comoyo.com/cleopatra/?customProfile=http://firefoxos-public.comoyo.com/profiles/perf_webrtc_h261_dolphin_20140521-1.txt

In cleopatra, filter on 'hw_get_module' and you will see 688 samples inside hw_get_module or hw_get_module_by_class, mostly inside gralloc_lock or gralloc_unlock. The 688 samples are almost 2.6% of the total 26554 samples in the profile = 2.6% of the CPU's time spent in hw_get_module.

Looking closer at vendor/sprd/open-source/libs/gralloc/gralloc_module.cpp, we can see that the hw_get_module calls are there to load a module so that a function can be called on it. For instance (m being the module):
ion_invalidate_fd(m->ion_client, hnd->share_fd);

The reason hw_get_module is so expensive is, as we can see it in the profile, because it locates and loads a shared library.

Changing this to only calling hw_get_module once and then holding on to the module would completely get rid of those 2.6%. An easy catch in my opinion.
Blocks: dolphin
Sam, I think this is a POVB bug. can you ask someone looking into this? Thank!
Flags: needinfo?(sam.hua)
Whiteboard: [POVB]
Group: kddi-confidential
Group: kddi-confidential
Flags: needinfo?(sam.hua)
FYI, here's a patch that fixes the problem.
Flags: needinfo?(sam.hua)
okay, i will ask someone to check it.
Flags: needinfo?(sam.hua)
Sam, please try Andrew.Wu's patch.
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: