Linux Container Development
 help / color / mirror / Atom feed
From: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
To: Daniel Lezcano <daniel.lezcano-GANU6spQydw@public.gmane.org>
Cc: Linux Containers
	<containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>,
	Balbir Singh1
	<balbir.singh-xthvdsQ13ZrQT0dZR+AlfA@public.gmane.org>,
	Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Subject: Re: cgroup information proc file format
Date: Thu, 11 Aug 2011 18:30:29 -0300	[thread overview]
Message-ID: <4E4449F5.3010909@parallels.com> (raw)
In-Reply-To: <4E4441C3.5020603-GANU6spQydw@public.gmane.org>

On 08/11/2011 05:55 PM, Daniel Lezcano wrote:
> Hi all,
>
> the cgroup cpuset and memory reduce access to a part of the resources on
> the system. Some applications use the /proc/cpuinfo and /proc/meminfo to
> allocate the resources. For instance, HPC jobs look at /proc/cpuinfo to
> fork the number of cpu found in this file either look at /proc/meminfo
> to allocate a big chunk of memory. Each process set the affinity on each
> cpu, which in case a subset of cpus is used, some affinity will fail.
>
> In the case of the container, the cgroup is used to reduce the memory or
> to assign a cpu to the container. Unfortunately, as this partitioning is
> not reflected in /proc, the different system tools (ps, top, free, ...)
> show a wrong information.
>
> I was wondering if that would make sense to create for the different
> cgroup subsystem, when it is relevant, a proc formatted file we can bind
> mount /proc.
>
> For example: /cgroup/memory.proc and /cgroup/cpuset.proc

Not only that. user/sys/nice,etc statistics also are expected to be 
different than the main system one, among other things.

One way I was thinking of doing it, was to always show per-cgroup
data in /proc files when relevant, using the cgroup of the current
process as a base.

bind mounting proc files from their cgroup is a nice alternative, 
though. But it leaves the possibility of any user of it not setting it 
up. Although it is certainly more flexible, it makes me wonder if a 
constrained process should ever know about resources it can't access...

If bind mounts are used, I'd suggest we represent them as directories,
like cpuset.proc/cpuinfo. (It is not clear for me what exactly you meant
in your proposal, sorry if it was just that). This might make things 
easier to setup an isolated /proc, since we can convention that anything
in this format is available to be bind mounted, instead of having to
convention that /cgroup/cpuset.proc means /proc/cpuinfo (May matter for 
future features)

> Any ideas ?
>
>    -- Daniel
>
>
> _______________________________________________
> Containers mailing list
> Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linux-foundation.org/mailman/listinfo/containers

  parent reply	other threads:[~2011-08-11 21:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 20:55 cgroup information proc file format Daniel Lezcano
     [not found] ` <4E4441C3.5020603-GANU6spQydw@public.gmane.org>
2011-08-11 21:30   ` Glauber Costa [this message]
     [not found]     ` <4E4449F5.3010909-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-08-11 21:45       ` Daniel Lezcano
     [not found]         ` <4E444D96.7080206-GANU6spQydw@public.gmane.org>
2011-08-11 21:52           ` Serge Hallyn
2011-08-11 22:58           ` Glauber Costa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E4449F5.3010909@parallels.com \
    --to=glommer-bzqdu9zft3wakbo8gow8eq@public.gmane.org \
    --cc=balbir.singh-xthvdsQ13ZrQT0dZR+AlfA@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=daniel.lezcano-GANU6spQydw@public.gmane.org \
    --cc=menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox