Re: cgroup information proc file format

Serge E. Hallyn
2011-10-06T12:50:51Z

> On 10/04/2011 06:05 PM, Serge Hallyn wrote:
> >Quoting Glauber Costa (glommer@parallels.com):
> >...
> >
> >>>Can't we just introduce the
> >>>/sys/fs/cgroup/memory/memory.proc etc files, and have the procfs code,
> >>>if cgroups are enabled and the task's memory cgroup != '/', return
> >>>the data from that file?
> >>
> >>First: If we're doing that, why do we need that file in the first place?
> >
> >We might not :) But we might, if we want to offer containers a choice of
> >whether /proc/meminfo is the host's or the container's.
>
> Hi,
>
> Please allow me to clarify some points so we are in the same page
> (thus avoiding fragmentation =p )
>
> Are you quoting /proc/meminfo as an example only, or are you
> concerned specifically with this file? I myself am talking about
> proc files in general.

An example. But as we are talking in terms of cgroups, I assumed this
was only about procfiles representing resources affected by cgroups -
like /proc/cpuinfo, /proc/meminfo, /proc/devices...

...

> Correct me if I am wrong, but it seems to me now that we agree that
> there should be a mechanism determining whether or not to
> automatically show cgroup-restrained values in proc files.

Agreed.

...

> BTW, A file in each cgroup:
>
> /sys/fs/cgroup/memory/memory.restrict_proc_data (or any other name)
> /sys/fs/cgroup/cpu/cpu.restrict_proc_data (or any other name)
> etc...
>
> works for me as well.

Cool.

-serge