Title: Samsung Enterprise Portal mySingle

Hello everyone,

    I am Prajwal, a System SW engineer at Samsung. I am writing this mail with regard to merging resourced (resource management daemon) into mainline Tizen code.

 

* Resourced is a daemon which manages cpu, memory, and network resources using cgroups. This daemon contains cpu, network, memory, swap, vip and logging modules to manage the resources.

* It caters to low memory situations and kills processes appropriately according to the memory needs and the oom score of the process (resourced adjusts the oom score of the processes so that the processes that have not been used recently have higher oom score).

* It manages cpu sharing using cpu cgroups and manages network activity using netfilter and iptables.

* To ensure that certain critical tasks are not killed, vip module has been added. This module uses the release agent concept in cgroups to reboot the system when such critical processes are killed.
* Tasks are organized into different cgroups using the process management module and the respective resource module. Logging of changes induced by the different modules is supported by the logging module.

 

    There was a proposal some time back to merge resourced into Tizen common code, and Murphy was proposed as an alternative. I have had a look at Murphy and the system monitor plugin and here are my observations.

 

* Murphy is general purpose resource policy daemon. It right now caters audio and video domains, but has the architecture to extend to monitoring other resources as well. Murphy provides the infrastructure to write plugins to manage the resources.

* System monitor plugin monitors the CPU and memory usages (using the /proc file system) and has the facility to trigger set of actions based on changes in the usage (though right now the changes are just being logged). It also has support for adding and handling cgroups (memory, cpuacct, cpu and freezer cgroups).

* Resourced rather caters to process management in terms of memory (ordering processes to be killed in low memory situations), cpu (using cpu cgroups), network (using net_cls cgroup to categorize processes and netfilter to monitor network usage) and criticalness (using the vip cgroup to ensure special processes are not killed).

* Though it is technically possible to rewrite resourced daemon using the abstractions provided by the system monitor (as had been suggested in the previous proposal), I feel that to accomplish this we would have to rewrite the entire code of resourced (barring the code that manages cgroups) in the scripting abstraction provided by system monitor. This code would include all of the decision logic in resourced and this duplication is not worth the effort.

* However, we can merge resourced (in its current form) with a little modification into murphy as a plugin. This would mean duplication of the code that manages cgroups (in system-monitor and resourced plugins) but would be a more efficient way of integrating the two daemons.

 

    The code of resourced can be found at /platform/core/system/resourced (in the tizen gerrit - https://review.tizen.org).

 

    I have opened a JIRA issue at https://bugs.tizen.org/jira/browse/TC-2377 to track the progress of this proposal. I request you to please reply to this mail (or comment on the JIRA issue) with your thoughts on this proposal and my observations on Murphy.

 

Thank you,

Prajwal

_______________________________________________
Dev mailing list
Dev@lists.tizen.org
https://lists.tizen.org/listinfo/dev

Reply via email to