Ticket #1813 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

Excessive enlightenment. CPU/syscalls

Reported by: alvieboy Owned by: openmoko-devel
Priority: normal Milestone: Om2008.8
Component: unknown Version: Om2008.8
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: PatchReviewResult:
Reproducible:

Description

enlightenment shipped with Om2008.8 eats a lot of CPU (average 6%), and seems to do some "stupid" things.

This is a 10s run of strace on the process, showing just the summary:

# time strace -c -p 1419
Process 1419 attached - interrupt to quit
Process 1419 detached
% time seconds usecs/call calls errors syscall


31.38 0.016566 64 260 select
27.79 0.014673 16 899 gettimeofday
23.61 0.012465 204 61 stat64

6.49 0.003428 7 515 ioctl
3.64 0.001924 481 4 write
1.59 0.000840 168 5 munmap
1.54 0.000813 163 5 mmap2
1.42 0.000752 68 11 1 read
1.32 0.000695 70 10 fstat64
1.20 0.000636 127 5 fcntl64
0.00 0.000000 0 15 5 open
0.00 0.000000 0 10 close
0.00 0.000000 0 2 poll
0.00 0.000000 0 10 getdents64


100.00 0.052792 1812 6 total
real 0m 10.10s
user 0m 0.38s
sys 0m 1.37s

This makes about 180 syscalls/second.

But the most "stupid" one is enlightnment stat'ing "/usr/share/enlightenment/data/themes/illume.edj" about 6 times per second. Also it iterates over USB devices, but I am not sure what for.

These dumps were made with Neo idling.

Is this an enlightenment defect/feature, or Om build of enlightenment ?

Change History

comment:1 Changed 11 years ago by raster

  • Status changed from new to closed
  • Version changed from GTA02v5 to OM-2008.08
  • Resolution set to fixed

ok. going to have to disagree. 6%?

here: not actually doing anything (like playing with the shelf or launching apps or anything):

top - 09:34:51 up 4:51, 1 user, load average: 0.31, 0.28, 0.22
Tasks: 62 total, 1 running, 61 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.5%us, 0.8%sy, 0.0%ni, 98.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 123920k total, 99176k used, 24744k free, 148k buffers
Swap: 0k total, 0k used, 0k free, 57708k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

1732 root 20 0 2252 1100 888 R 1.1 0.9 0:01.50 top

5 root 15 -5 0 0 0 S 0.1 0.0 0:21.06 events/0

1408 root 20 0 16844 7588 4700 S 0.1 6.1 1:20.25 enlightenment

that's asu.dev (not 2008.08 - the e version etc. there is different, it was not the release i prepared for asu but some earlier snap).

that's top with a poll interval of 10 seconds. so over 10 seconds, 0.1% cpu... not 6. :(

secondly - stat() is an absolute must. that file can change. whenever data is requested from a theme file - the file needs to be stat()ed before being open()'d to see if the modified time has changed (and thus if the internally cached data is to be used or to be dirtied and a new fresh off-disk version be used). without that you will get stale cache entries. example. in code you delete a file - .edj, .png, .jpg - doesn't matter (.edj files are image file - they contain multiple images encoded in sections), now you replace that with some new image (untarred, copied, written - doesn't matter) and you then want to load it - but you loaded it before you overwrote it so it's in cache. if you DONT stat(), you will not get the changed/new image you wrote, but an old stale cache entry. so it's not "stupid". it's necessary. just looking at strace without knowing what the code does is not the greatest of things to do. (i see it all the time!). also the walking of the usb stuff is the bluetooth status gadget - it checks to find a bluetooth usb device and looks if it's powered on or not - can't remember the poll interval but it is every few seconds. i suspect that the version shipping in 2008.08 of illume/e simply doesn't contain a lot of changes i made the week before release. it's possibly some theme animation spinning that is doing things - but you can't see it (thus the stat's), or something else, but i can't reproduce. e is nice and dead quiet for me (see above and below). considering it handles a mountain of stuff (from monitoring battery, gsm signal, the clock, bluetooth power on/off, monitor for .desktop file changes, the launcher, window management and all the window property changes, and client requests etc.).

also.. i get nowhere near the amount of activity compared to you:

root@om-gta02:~# time strace -c -p 1408
Process 1408 attached - interrupt to quit
Process 1408 detached
% time seconds usecs/call calls errors syscall


45.87 0.002514 229 11 write
23.94 0.001312 55 24 gettimeofday
18.35 0.001006 59 17 1 read
11.84 0.000649 130 5 fcntl64

0.00 0.000000 0 15 5 open
0.00 0.000000 0 10 close
0.00 0.000000 0 17 ioctl
0.00 0.000000 0 5 munmap
0.00 0.000000 0 7 select
0.00 0.000000 0 5 mmap2
0.00 0.000000 0 1 stat64
0.00 0.000000 0 10 fstat64
0.00 0.000000 0 10 getdents64
0.00 0.000000 0 1 accept
0.00 0.000000 0 1 getpeername


100.00 0.005481 139 6 total
real 0m 10.35s
user 0m 0.04s
sys 0m 0.16s

Note: See TracTickets for help on using tickets.