Back to home page

OSCL-LXR

 
 

    


0001 ==================
0002 Control Groupstats
0003 ==================
0004 
0005 Control Groupstats is inspired by the discussion at
0006 https://lore.kernel.org/r/461CF883.2030308@sw.ru and implements per cgroup statistics as
0007 suggested by Andrew Morton in https://lore.kernel.org/r/20070411114927.1277d7c9.akpm@linux-foundation.org.
0008 
0009 Per cgroup statistics infrastructure re-uses code from the taskstats
0010 interface. A new set of cgroup operations are registered with commands
0011 and attributes specific to cgroups. It should be very easy to
0012 extend per cgroup statistics, by adding members to the cgroupstats
0013 structure.
0014 
0015 The current model for cgroupstats is a pull, a push model (to post
0016 statistics on interesting events), should be very easy to add. Currently
0017 user space requests for statistics by passing the cgroup path.
0018 Statistics about the state of all the tasks in the cgroup is returned to
0019 user space.
0020 
0021 NOTE: We currently rely on delay accounting for extracting information
0022 about tasks blocked on I/O. If CONFIG_TASK_DELAY_ACCT is disabled, this
0023 information will not be available.
0024 
0025 To extract cgroup statistics a utility very similar to getdelays.c
0026 has been developed, the sample output of the utility is shown below::
0027 
0028   ~/balbir/cgroupstats # ./getdelays  -C "/sys/fs/cgroup/a"
0029   sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0
0030   ~/balbir/cgroupstats # ./getdelays  -C "/sys/fs/cgroup"
0031   sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2