On Wednesday 03 December 2014 08:20:46 Carsten Haitzler wrote:
> > The only way for userspace to get the information is via /proc/*/smaps
> > and 
> > that is not sufficient. For this daemon to work, we should really get a
> > kernel feature.
> 
> we also need events from the kernel. a kernel event saying "help  - we are
> low on memory - please do something now!". otherwise this daemon is left to
> have to poll and polling is not pretty on power and means the best response
> time of a "memory shortage" is dependent on polling interval.. and this is
> an eternal fight between power usage and response. events please.

Agreed. We need that information *before* we run out of memory. When the OOM 
killer triggers, as Dominique said, all hope is probably lost.

A simple implementation of the resource manager could simply monitor 
/proc/meminfo and then notify applications when it thinks resources go low. I 
see problems with that:

 1) polling, like you said
 2) polling intervals will get higher if the system is out of memory, so a 
    runaway application will cause the daemon to fail to report properly
    (you could run it in real-time priority, but this will open another can of 
     worms)
 3) which applications does the manager notify? All of them? Then you trigger
    "thundering herd" problem and you'll probably cause *more* memory to be 
     allocated, especially if portions of some of the targeted applications 
     had been swapped out or dropped from RSS
 4) if it's targetting, how will it get the right information? Remember what I 
    said about /proc/*/smaps

I think this is an interesting feature, but I think it is one that need to be 
done very carefully.

Oh, by the way, it's too late for 3.0. We're probably talking a 3.1 feature 
here.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

_______________________________________________
Dev mailing list
[email protected]
https://lists.tizen.org/listinfo/dev

Reply via email to