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: Tuesday, August 26, 2008 - 6:41 am

On Mon, Aug 25, 2008 at 05:54:39PM -0700, Paul Menage wrote:

Once ftpd does seteuid() or setreuid() again to switch effective user to
"root", it will be moved back to original group (root's group).

So basic question is if a program changes its effective user id temporarily
to user B than all the resource consumption should take place from the
resources of user B or should continue to take place from original cgroup.

I would think that we should move the task temporarily to B's cgroup and
bring back again upon identity change.

At the same time I can also understand that this behavior can probably
be considered over-intrusive and some people might want to avoid that.

Two things come to my mind.

- Users who find it too intrusive, can just shut down the rules based
  daemon.

- Or, we can implement selective movement of tasks by daemon as suggested by
  you. This will make system more complex but provides more flexibility
  in the sense users can keep daemon running at the same time control
  movement of certain tasks.




So there can be two kind of controls.

- Create a per cgroup file say "group_pinned", where if 1 is written to
  "group_pinned" that means daemon will not move tasks from this cgroup upon
  effective uid/gid changes.

- Provide more fine grained control where task movement is not controlled
  per cgroup, rather per thread id. In that case every cgroup will contain
  another file "tasks_pinned" which will contain all the tids which cannot
  be moved from this cgroup by daemon. By default this file will be empty
  and all the tids are movable.

I think initially we can keep things simple and implement "group_pinned" 
which provides coarse control on the whole group and pins all the tasks
in that cgroup.

Thoughts?

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, (Tue Aug 26, 6:41 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)