Openmoko Bug #1813: Excessive enlightenment. CPU/syscalls

Openmoko Public Trac bugs at docs.openmoko.org
Wed Aug 13 02:05:00 CEST 2008


#1813: Excessive enlightenment. CPU/syscalls
----------------------+-----------------------------------------------------
 Reporter:  alvieboy  |        Owner:  openmoko-devel
     Type:  defect    |       Status:  closed        
 Priority:  normal    |    Milestone:  Om2008.8      
Component:  unknown   |      Version:  OM-2008.08    
 Severity:  normal    |   Resolution:  fixed         
 Keywords:            |     Blocking:                
Blockedby:            |  
----------------------+-----------------------------------------------------
Changes (by raster):

  * status:  new => closed
  * version:  GTA02v5 => OM-2008.08
  * resolution:  => fixed


Comment:

 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 at 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

-- 
Ticket URL: <https://docs.openmoko.org/trac/ticket/1813#comment:1>
docs.openmoko.org <http://docs.openmoko.org/trac/>
openmoko trac


More information about the buglog mailing list