Re: OOM conditions

2009-11-07 Thread Martin Dengler
On Fri, Nov 06, 2009 at 04:50:53PM +, Tomeu Vizoso wrote:
 On Wed, Nov 4, 2009 at 14:16, Martin Dengler mar...@martindengler.com wrote:
  On Fri, Oct 30, 2009 at 11:22:13PM +0100, Tomeu Vizoso wrote:
  On Fri, Oct 30, 2009 at 16:58, Richard A. Smith rich...@laptop.org wrote:
   Working the table at the Boston book festival I was reminded how
   painful the OOM stuff is on a gen 1. The demo machines were in
   this state a lot as each visitor would open up a new
   program.  Basically you have to just turn the unit off and restart
   as trying to recover is futile.
 
  What if activities had a higher oom_score? Would that protect enough
  the processes that once killed require a system restart (X, shell,
  etc)?
 
  See patch vs sugar-toolkit HEAD below[1] (I can backport to 0.82 if
  wanted).
 
 Maybe would be better to have the shell do that? So it works for
 non-python activities.

Patch inline below.

  Regards,
 
  Tomeu
 
  Martin
 
 Thanks,
 
 Tomeu

Martin


(untested) patch against
http://cgit.sugarlabs.org/sugar-toolkit/mainline/tree/src/sugar/activity/activityfactory.py
:

From 4bd6fb9f7f245c2aed92d6964746627d0c96cbec Mon Sep 17 00:00:00 2001
From: Martin Dengler mar...@martindengler.com
Date: Sat, 7 Nov 2009 10:55:16 +
Subject: [PATCH] sacrifice activities to the OOM killer first

change the OOM-killer score of launched activities to be the maximum.
See discussion at http://linux-mm.org/OOM_Killer
---
 src/sugar/activity/activityfactory.py |   35 +
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/src/sugar/activity/activityfactory.py 
b/src/sugar/activity/activityfactory.py
index ee0fd92..5deee6e 100644
--- a/src/sugar/activity/activityfactory.py
+++ b/src/sugar/activity/activityfactory.py
@@ -65,6 +65,39 @@ def _close_fds():
 pass
 
 
+def __oom_adj_pid(pid, omm_adj_value=None):
+ Change a process' OOM likelihood to oom_adj_value.
+
+By default, use the value of gconf path
+/desktop/sugar/performance/oom_adj_default; if none exists, make
+this process most likely to be killed (oom_adj_value=15).
+
+Linux-specific.  See http://linux-mm.org/OOM_Killer for details.
+
+oom_adj_fullpath = /proc/%s/oom_adj % pid
+if os.path.exists(oom_adj_fullpath):
+try:
+
+# get values/defaults from gconf
+import gconf
+gconf_dir = /desktop/sugar/performance
+gconf_key = oom_adj_default
+client = gconf.client_get_default()
+if not client.dir_exists(gconf_dir):
+client.add_dir(gconf_dir, gconf.CLIENT_PRELOAD_NONE)
+if oom_adj_value is None:
+oom_adj_value = client.get_int(gconf_dir + / + gconf_key)
+if oom_adj_value is None:
+oom_adj_value = 15
+client.set_int(gconf_dir + / + gconf_key,
+   oom_adj_value)
+
+file(oom_adj_fullpath).write(oom_adj_value)
+
+except:
+pass
+
+
 def create_activity_id():
 Generate a new, unique ID for this activity
 pservice = presenceservice.get_instance()
@@ -276,6 +309,8 @@ class ActivityCreationHandler(gobject.GObject):
 stdout=log_file.fileno(),
 stderr=log_file.fileno())
 
+__oom_adj_pid(child.pid)
+
 gobject.child_watch_add(child.pid,
 _child_watch_cb,
 (environment_dir, log_file))
-- 
1.6.2.5



pgptlRP7tORQh.pgp
Description: PGP signature
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Fedora 12 build for XO-1.5

2009-11-07 Thread Daniel Drake
I built a F12 image based off our F11 distro in order to help diagnose
one of our video problems. Here it is incase it's useful for any other
efforts:

http://dev.laptop.org/~dsd/f12-xo1.5/


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] On Sugar 0.84 - status of the Chat/collab leader issue...

2009-11-07 Thread David Van Assche
Hi,
   So I was looking over the code with some of the #telepathy guys who are
also under the impression that sugar.presence code could be causing many of
the collab problems. Main issue is redundancy of code... a lot of what is
happening in sugar.presence already happens in telepathy (actually there are
even comments in sugar.presence code stating this) but until we know to what
level activities are using sugar.presence, we can't really do anything...
since activities would break, I guess we'd need to know what in the
sugar.presence modules is being really actively used to migrate to MC 5...
and give a warning or something, or keep some kind of sym links to the old
functions... I dunno, kinda above my level of expertise...

regards,
David van Assche

On Fri, Nov 6, 2009 at 2:02 PM, Tomeu Vizoso to...@sugarlabs.org wrote:

 On Wed, Nov 4, 2009 at 13:16, Benjamin M. Schwartz
 bmsch...@fas.harvard.edu wrote:
  Martin Langhoff wrote:
  On Tue, Nov 3, 2009 at 9:54 PM, David Van Assche dvanass...@gmail.com
 wrote:
  moving to mission control 5 and letting go of the admittedly
  antiquated sugar presence now
  ...
  If you play with a major component replacement
 
   - test it for scalability  stability over wifi before doing a lot of
  integration work
 
  It's worth noting that moving from the Sugar Presence Service to Mission
  Control 5 would not alter our network protocols.  This is purely a change
  in how the client software is organized.  Neither regression nor
  improvement in wireless network performance should occur.

 Was about to say this, the work means making sugar activities' code
 more similar to GNOME apps, while also removing a daemon. This could
 have some effect on how the network is used, but chances are it won't.

 As a first step in removing the PS, I think we should try to implement
 the python presence API with MC5 instead of PS. Then we can either
 drop the PS or make it a compatibility shim with MC5 while activities
 such as eToys make the move.

 We can also take the chance to develop a better API if there's need for it.

 But in any case, we need to do some exploration now before we can
 discuss it in detail.

 Regards,

 Tomeu

 --
 «Sugar Labs is anyone who participates in improving and using Sugar.
 What Sugar Labs does is determined by the participants.» - David
 Farning
 ___
 Sugar-devel mailing list
 sugar-de...@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel




-- 

Marie von 
Ebner-Eschenbachhttp://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html
- Even a stopped clock is right twice a day.
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


OS38 don't boot

2009-11-07 Thread LASKE, Lionel (C2S)
Hi all,

I've upgraded the XO 1.5 using the os38.zd. I'm on q3a15.

It seems to work (no error message) but unfortunately at the end of the process 
Sugar don't boot : hang on the first dot.
Don't work better after removing the battery.

Any idea ?

Lionel.


P.S.:Capture of the problem here: 
http://olpc-france.org/wiki/images/thumb/4/41/IMG_0186.JPG/450px-IMG_0186.JPG
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS38 don't boot

2009-11-07 Thread Paul Fox
lionel -- please try booting again, this time hold the check
key down while booting.  (that's the rightmost key in the group
of 4 to the right of the screen:  square, circle, X, and check.)

that should give more information about what's failing.

paul

c2s wrote:
  Hi all,
  
  I've upgraded the XO 1.5 using the os38.zd. I'm on q3a15.
  
  It seems to work (no error message) but unfortunately at the end of the 
  process 
  Sugar don't boot : hang on the first dot.
  Don't work better after removing the battery.
  
  Any idea ?
  
  Lionel.
  
  
  P.S.:Capture of the problem here: 
  http://olpc-france.org/wiki/images/thumb/4/41/IMG_0186.JPG/450px-IMG_0186.JPG
  part 2 text/plain 129
  ___
  Devel mailing list
  Devel@lists.laptop.org
  http://lists.laptop.org/listinfo/devel

=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


RE: OS38 don't boot

2009-11-07 Thread LASKE, Lionel (C2S)

I've tried and... it works now.
It was the shallow copy that take a long time and let me think that the 
laptop was hang. So I stupidly powered off that laptop without waiting :-(
Sorry to don't have enough patience.

Lionel.


-Message d'origine-
De : Paul Fox [mailto:p...@laptop.org] 
Envoyé : samedi 7 novembre 2009 22:47
À : LASKE, Lionel (C2S)
Cc : OLPC Devel
Objet : Re: OS38 don't boot 

lionel -- please try booting again, this time hold the check
key down while booting.  (that's the rightmost key in the group
of 4 to the right of the screen:  square, circle, X, and check.)

that should give more information about what's failing.

paul

c2s wrote:
  Hi all,
  
  I've upgraded the XO 1.5 using the os38.zd. I'm on q3a15.
  
  It seems to work (no error message) but unfortunately at the end of the 
  process 
  Sugar don't boot : hang on the first dot.
  Don't work better after removing the battery.
  
  Any idea ?
  
  Lionel.
  
  
  P.S.:Capture of the problem here: 
  http://olpc-france.org/wiki/images/thumb/4/41/IMG_0186.JPG/450px-IMG_0186.JPG
  part 2 text/plain 129
  ___
  Devel mailing list
  Devel@lists.laptop.org
  http://lists.laptop.org/listinfo/devel

=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] MANIFEST experiments

2009-11-07 Thread Philipp Kocher
The patch is good to reduce the boot time, but doesn't work for activity 
developers.
After applying the patch I run setup.py dist_xo of an activity and got 
the following error (since read_manifest is supposed to set 
self.manifest and doesn't do it anymore):
Traceback (most recent call last):
   File ./setup.py, line 3, in module
 bundlebuilder.start()
   File 
/usr/lib/python2.5/site-packages/sugar/activity/bundlebuilder.py, line 
493, in start
 globals()['cmd_' + args[0]](config, args[1:])
   File 
/usr/lib/python2.5/site-packages/sugar/activity/bundlebuilder.py, line 
284, in cmd_dist_xo
 packager.package()
   File 
/usr/lib/python2.5/site-packages/sugar/activity/bundlebuilder.py, line 
184, in package
 missing_files = self.builder.check_manifest()
   File 
/usr/lib/python2.5/site-packages/sugar/activity/bundlebuilder.py, line 
147, in check_manifest
 if path not in self.config.bundle.manifest:
TypeError: argument of type 'NoneType' is not iterable


Regards,
Philipp


James Cameron wrote:
 Confirmed.
 
 On Wed, Oct 14, 2009 at 05:29:09PM +0545, Daniel Drake wrote:
 So, I reflashed 2 XOs, booted for the first time, entered a name. On
 one, I modified sugar.bundle.ActivityBundle.read_manifest() to be a
 no-op, then turned it off. On the other, I just turned it off.
 
 I reproduced this experiment.  Used build 802, with a limited set of 22
 activities [1], with a similar change [2].
 
 Then I powered both on at the same time and started a stopwatch. I
 measured how long it takes for the XOs to reach the stage of boot
 where the XO stick figure and the activity icons are visible.
 
 1255565448 power up both XOs
 1255565533 modified XO boot complete
 1255565539 unmodified XO boot complete
 
 The one with the modification reached this point *55* seconds faster
 than the other one!
 
 In my case, about 6 seconds.
 
 I feel that even this small time was worth it, so I plan to patch this
 for the friends' kids I've got laptops deployed to.
 
 Is there a collection of 802 performance improvement patches?
 
 Notes:
 
 1.  the activities installed were from G1G1 Activities for 8.2 and
 were Browse Calculate Chat Distance Etoys Implode Maze Measure Memorize
 Moon Paint Pippy Read Record Ruler Scratch Speak TamTamMini
 TamTamSynthLab Terminal TurtleArt Write
 
 2.  the change was to activitybundle.py in
 /usr/lib/python2.5/site-packages/sugar/bundle/ and removed all code in
 read_manifest(), leaving just pass:
 
 def read_manifest(self):
 pass
 
 
 
 
 
 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel