Re: [RFC] [PATCH -mm] cgroup: uid-based rules to add processes efficiently in the right cgroup

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Vivek Goyal
Date: Monday, August 18, 2008 - 5:35 am

On Sun, Aug 17, 2008 at 12:33:31PM +0200, Andrea Righi wrote:

Hi  Andrea,

Recently I introduced the infrastructure in libcgroup to handle
the task placement issue based on uid and gid rules. This is what I did.

- Introduced two new APIs in libcgroup to place the task in right cgroup.
	- cgroup_change_cgroup_uid_gid
		Pleces the task in destination cgroup based on uid/gid
		rules specified in /etc/cgrules.conf
	- cgroup_change_cgroup_path
		Puts the task into the cgroup specified by caller

- Provided two command line tools (cgexec and cgclassify) to perform
  various process placement related tasks.
	- cgexec
		A tool to launch a task in user specfied cgroup
	- cgclassify
		A tool to re-classify already running tasks.

- Wrote a pam plugin so that tasks are placed in right user groups upon
  login or reception of other services which take pam's help.

- Currently work is in progress for a user space daemon which will 
  automatically place the tasks based on notifications.

For your environment, where delay is unbearable, I think you can modify
the daemon to use libcgroup to place the forked task in right cgroup
before actually executing it. Once the task has been placed in right
cgroup, exec() will be called.

We have been doing all the user space development on following mailing
list.

https://lists.sourceforge.net/lists/listinfo/libcg-devel

Latest patches which got merged in libcgroup, are here.

http://sourceforge.net/mailarchive/forum.php?thread_name=20080813171720.108005557%40re...

It is accompanied with a decent README file for design details and for
how to use it.

I think modifying the daemon to make use of libcgroup is the right way
to handle this issue than duplicating the infrastructure in user space
as well as kernel space.

Thanks
Vivek
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Tue Jul 1, 12:11 pm)
RE: [RFC] How to handle the rules engine for cgroups, Kazunaga Ikeno, (Wed Jul 2, 2:33 am)
Re: [RFC] How to handle the rules engine for cgroups, KAMEZAWA Hiroyuki, (Wed Jul 2, 6:19 pm)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 3, 8:54 am)
Re: [RFC] How to handle the rules engine for cgroups, KAMEZAWA Hiroyuki, (Thu Jul 3, 5:34 pm)
Re: [RFC] How to handle the rules engine for cgroups, Balbir Singh, (Tue Jul 8, 2:35 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Tue Jul 8, 6:45 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Thu Jul 10, 2:07 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Thu Jul 10, 2:23 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 7:06 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 7:30 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 7:33 am)
Re: [RFC] How to handle the rules engine for cgroups, Rik van Riel, (Thu Jul 10, 7:48 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 8:40 am)
Re: [RFC] How to handle the rules engine for cgroups, Dhaval Giani, (Thu Jul 10, 8:42 am)
Re: [RFC] How to handle the rules engine for cgroups, Ulrich Drepper, (Thu Jul 10, 8:56 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Thu Jul 10, 9:41 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Thu Jul 10, 9:46 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Thu Jul 10, 9:51 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 10:19 am)
Re: [RFC] How to handle the rules engine for cgroups, Rik van Riel, (Thu Jul 10, 10:25 am)
Re: [RFC] How to handle the rules engine for cgroups, Ulrich Drepper, (Thu Jul 10, 10:39 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 11:41 am)
Re: [RFC] How to handle the rules engine for cgroups, Ulrich Drepper, (Thu Jul 10, 3:29 pm)
Re: [RFC] How to handle the rules engine for cgroups, KAMEZAWA Hiroyuki, (Thu Jul 10, 5:55 pm)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Mon Jul 14, 6:57 am)
Re: [RFC] How to handle the rules engine for cgroups, David Collier-Brown, (Mon Jul 14, 7:44 am)
Re: Re: [RFC] How to handle the rules engine for cgroups, kamezawa.hiroyu, (Mon Jul 14, 8:07 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Mon Jul 14, 8:21 am)
RE: [RFC] How to handle the rules engine for cgroups, Kazunaga Ikeno, (Thu Jul 17, 12:05 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 17, 6:47 am)
Re: [RFC] How to handle the rules engine for cgroups, KAMEZAWA Hiroyuki, (Fri Jul 18, 2:52 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Fri Jul 18, 8:46 am)
Re: [RFC] How to handle the rules engine for cgroups, Balbir Singh, (Fri Jul 18, 9:39 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Fri Jul 18, 11:55 am)
Re: Re: [RFC] How to handle the rules engine for cgroups, kamezawa.hiroyu, (Fri Jul 18, 4:05 pm)
Re: Re: [RFC] How to handle the rules engine for cgroups, kamezawa.hiroyu, (Fri Jul 18, 4:10 pm)
Re: [RFC] [PATCH -mm] cgroup: uid-based rules to add proce ..., Vivek Goyal, (Mon Aug 18, 5:35 am)
Re: [RFC] [PATCH -mm] cgroup: uid-based rules to add proce ..., David Collier-Brown, (Tue Aug 26, 8:04 am)
Re: [RFC] [PATCH -mm] cgroup: uid-based rules to add proce ..., David Collier-Brown, (Tue Aug 26, 9:32 am)