#9924 NORM Not Tri: sugar logs opened O_SYNC

Zarro Boogs per Child bugtracker at laptop.org
Tue Dec 22 20:20:50 EST 2009


#9924: sugar logs opened O_SYNC
--------------------------+-------------------------------------------------
 Reporter:  Quozl         |                 Owner:               
     Type:  defect        |                Status:  new          
 Priority:  normal        |             Milestone:  Not Triaged  
Component:  not assigned  |               Version:  not specified
 Keywords:                |           Next_action:  never set    
 Verified:  0             |   Deployment_affected:               
Blockedby:                |              Blocking:               
--------------------------+-------------------------------------------------
 On os64, Terminal started from Journal takes between 2 and 8 seconds to
 start, and 2 and 8 seconds to stop; and the time taken varies
 considerably.

 An strace shows that the occasional long delays are due to write(2) of the
 stderr file descriptor to the sugar logs.  Sugar opens the logs with
 O_SYNC.  The writes are therefore synchronous.

 {{{
 strace.2377:00:45:02.964673
 open("/home/olpc/.sugar/default/logs/org.laptop.Terminal-14.log",
 O_WRONLY|O_CREAT|O_EXCL|O_SYNC|O_LARGEFILE, 0644) = 39
 }}}

 Placing the .sugar/default/logs filesystem on a tmpfs is a workaround; it
 reduces the variation in starting time to between 2 and 3 seconds.  But
 this loses valuable diagnostic data for post event analysis.

 Reducing the spurious messages in the logs might also increase
 performance.

 Also, Sugar tries to open org.laptop.Terminal-1.log and if it already
 exists tries org.laptop.Terminal-2.log and so on until a free slot is
 found.  This extra processing is trivial; at about 1ms per file, but it
 grows in a session according to how many times an activity is started.

-- 
Ticket URL: <http://dev.laptop.org/ticket/9924>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list