mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul Menage" <menage@google.com>
To: balbir@linux.vnet.ibm.com
Cc: "Dhaval Giani" <dhaval@linux.vnet.ibm.com>,
	vivk@us.ibm.com, "Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"Balbir Singh" <balbir@in.ibm.com>,
	"Srivatsa Vaddagiri" <vatsa@linux.vnet.ibm.com>,
	lkml <linux-kernel@vger.kernel.org>,
	libcg-devel <libcg-devel@lists.sourceforge.net>,
	"Balaji Rao" <balajirrao@gmail.com>
Subject: Re: [Libcg-devel] cgroupstats, plans?
Date: Mon, 12 May 2008 23:10:48 -0700	[thread overview]
Message-ID: <6599ad830805122310q2f403745kd114ec11a8e51b1d@mail.gmail.com> (raw)
In-Reply-To: <481ADB66.1010007@linux.vnet.ibm.com>

On Fri, May 2, 2008 at 2:14 AM, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
>
>  I would prefer to select the controller from user stats and then dump the stats
>  from the kernel for that controller using cgroupstats.
>

Yes, that's fine if you're not worried about the cost of some stats
being excessive. I'm not sure whether that's going to be the case or
not. What about those control files that are of type string? Do we
want to return them as stats?

If we're going to use the cgroupstats API, I think we should avoid
having to have each controller have to publish a binary API - we have
the name->type information already in the control file structures.

So how about something like this as the hard-coded part of the API?
(probably needs to be tidied up to fit into the taskstats format)

a new command CGROUP_STATS_GET_API which returns a sequence of
structures of the form:

struct cgroup_stat_subsys {
  u32 reclen;
  u32 id;
  u32 numstats;
  char name[];
};

enum {
  CGROUP_STAT_TYPE_U64,
  CGROUP_STAT_TYPE_S64,
  CGROUP_STAT_TYPE_STRING, /* maybe */
  CGROUP_STAT_TYPE_U64MAP,
};

struct cgroup_stat_type {
  u32 reclen;
  u32 id;
  u32 type;
  char name[];
};

When the user sends a CGROUP_STATS_GET_API request they get a sequence
of cgroup_stat_subsys records (one for each subsystem on that
hierarchy), each followed by the stats available for that subsystem.
E.g.

{ 0, 3, "memory" }
{ 0, CGROUP_STAT_TYPE_U64, "usage_in_bytes" }
{ 1, CGROUP_STAT_TYPE_U64, "limit_in_bytes" }
{ 2, CGROUP_STAT_TYPE_U64MAP, "stat" }
{ 1, 1, "cpuacct" }
{ 0, CGROUP_STAT_TYPE_U64, "usage" }

a new command CGROUP_SET_STATS_REQUEST that lets you tie a particular
set of stats to a given socket. E.g. the parameter structure could be
something like a sequence of records of the form:

struct cgroup_stats_request {
  u32 subsys_id;
  u32 stat_id;
}

Following a successful CGROUP_SET_STATS_REQUEST command, the user
could send a CGROUP_DUMP_STATS command on the same socket to get a
dump of the requested stats in the specified order.

Paul

      reply	other threads:[~2008-05-13  6:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 12:20 Dhaval Giani
2008-05-02  1:52 ` Paul Menage
2008-05-02  9:14   ` [Libcg-devel] " Balbir Singh
2008-05-13  6:10     ` Paul Menage [this message]

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=6599ad830805122310q2f403745kd114ec11a8e51b1d@mail.gmail.com \
    --to=menage@google.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=balajirrao@gmail.com \
    --cc=balbir@in.ibm.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=dhaval@linux.vnet.ibm.com \
    --cc=libcg-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vatsa@linux.vnet.ibm.com \
    --cc=vivk@us.ibm.com \
    /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

all inboxes | Powered by JetHome®