Re: [-mm][PATCH 3/4] Add rlimit controller accounting and control



On Sat, May 3, 2008 at 2:38 PM, Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> wrote:


This patch adds support for accounting and control of virtual address space
limits. The accounting is done via the rlimit_cgroup_(un)charge_as functions.
The core of the accounting takes place during fork time in copy_process(),
may_expand_vm(), remove_vma_list() and exit_mmap(). There are some special
cases that are handled here as well (arch/ia64/kernel/perform.c,
arch/x86/kernel/ptrace.c, insert_special_mapping())


The basic idea of the patches looks fine (apart from some
synchronization issues) but Is calling this the "rlimit" controller a
great idea? That implies that it handles all (or at least many) of the
things that setrlimit()/getrlimit() handle.

While some of the other rlimit things definitely do make sense as
cgroup controllers, putting them all in the same controller doesn't
really - paying for the address-space tracking overhead just to get,
say, the equivalent of RLIMIT_NPROC (max tasks) isn't a great idea.

Can you instead give this a name that somehow refers to virtual
address space limits, e.g. "va" or "as". That would still fit if you
expanded it to deal with locked virtual address space limits too.

I think that an "rlimit" controller would probably be best for
representing just those limits that don't really make sense when
aggregated across different tasks, but apply separately to each task
(e.g. RLIMIT_FSIZE, RLIMIT_CORE, RLIMIT_NICE, RLIMIT_NOFILE,
RLIMIT_RTPRIO, RLIMIT_STACK, RLIMIT_SIGPENDING, and maybe RLIMIT_CPU),
in order to provide an easy way to change these limits on a group of
running tasks.

On a separate note for the address-space tracking, ideally the
subsystem would track whether or not it was bound to a hierarchy, and
skip charging/uncharging if not. That way there's no (noticeable)
overhead for compiling in the subsystem but not using it. At the point
when the subsystem was bound to a hierarchy, it could at that point
run through all mms and charge each one's existing address space to
the appropriate cgroup. (Currently that would only be the root cgroup
in the hierarchy).

Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: IO scheduler based IO controller V10
    ... resources like cpu scheduling and memory controllers. ... Also Fernando tells me that memory controller did not support ... Enforcing limits is applicable in the scenario where you are managing ... fairness in terms of disk time can get us better results ...
    (Linux-Kernel)
  • Re: [RFC][0/3] Virtual address space control for cgroups (v2)
    ... I thought I addressed some of those by adding a separate config option. ... I am not against making it a separate controller. ... Trying to account/control physical memory or swap usage via virtual ... you suggested that VA limits provide a "soft-landing". ...
    (Linux-Kernel)
  • Re: PD(PI) Math Model (e.g.Tank Level) Still in need of CORRECTION!
    ... JCH wrote: ... In your latest example there are no limits to keep the controller from generating a negative output which implies the valve should some how increase the level in the tank or, in the case of heaters, cool the systems. ... For many control systems the loop is routinely driven into actuator saturation, or would be if the executive controller allows it -- any responsible designer will investigate what happens when the actuators saturate, and correct any nasty problems, before they call a system "good". ...
    (sci.engr.control)
  • Re: [-mm][PATCH 3/4] Add rlimit controller accounting and control
    ... The accounting is done via the rlimit_cgroup_charge_as functions. ... While some of the other rlimit things definitely do make sense as ... cgroup controllers, putting them all in the same controller doesn't ... expanded it to deal with locked virtual address space limits too. ...
    (Linux-Kernel)
  • Re: [PATCH -RSS] Add documentation for the RSS controller
    ... Page Cache controller ... Kernel user memory accounting and slab control ... The accounting information of each mm_struct is accumulated in the container. ... +the container that brought it in -- this will happen on memory pressure). ...
    (Linux-Kernel)