1. 09 8月, 2013 3 次提交
    • T
      cgroup: add css_parent() · 63876986
      Tejun Heo 提交于
      Currently, controllers have to explicitly follow the cgroup hierarchy
      to find the parent of a given css.  cgroup is moving towards using
      cgroup_subsys_state as the main controller interface construct, so
      let's provide a way to climb the hierarchy using just csses.
      
      This patch implements css_parent() which, given a css, returns its
      parent.  The function is guarnateed to valid non-NULL parent css as
      long as the target css is not at the top of the hierarchy.
      
      freezer, cpuset, cpu, cpuacct, hugetlb, memory, net_cls and devices
      are converted to use css_parent() instead of accessing cgroup->parent
      directly.
      
      * __parent_ca() is dropped from cpuacct and its usage is replaced with
        parent_ca().  The only difference between the two was NULL test on
        cgroup->parent which is now embedded in css_parent() making the
        distinction moot.  Note that eventually a css->parent field will be
        added to css and the NULL check in css_parent() will go away.
      
      This patch shouldn't cause any behavior differences.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NLi Zefan <lizefan@huawei.com>
      63876986
    • T
      cgroup: add/update accessors which obtain subsys specific data from css · a7c6d554
      Tejun Heo 提交于
      css (cgroup_subsys_state) is usually embedded in a subsys specific
      data structure.  Subsystems either use container_of() directly to cast
      from css to such data structure or has an accessor function wrapping
      such cast.  As cgroup as whole is moving towards using css as the main
      interface handle, add and update such accessors to ease dealing with
      css's.
      
      All accessors explicitly handle NULL input and return NULL in those
      cases.  While this looks like an extra branch in the code, as all
      controllers specific data structures have css as the first field, the
      casting doesn't involve any offsetting and the compiler can trivially
      optimize out the branch.
      
      * blkio, freezer, cpuset, cpu, cpuacct and net_cls didn't have such
        accessor.  Added.
      
      * memory, hugetlb and devices already had one but didn't explicitly
        handle NULL input.  Updated.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NLi Zefan <lizefan@huawei.com>
      a7c6d554
    • T
      cgroup: s/cgroup_subsys_state/cgroup_css/ s/task_subsys_state/task_css/ · 8af01f56
      Tejun Heo 提交于
      The names of the two struct cgroup_subsys_state accessors -
      cgroup_subsys_state() and task_subsys_state() - are somewhat awkward.
      The former clashes with the type name and the latter doesn't even
      indicate it's somehow related to cgroup.
      
      We're about to revamp large portion of cgroup API, so, let's rename
      them so that they're less awkward.  Most per-controller usages of the
      accessors are localized in accessor wrappers and given the amount of
      scheduled changes, this isn't gonna add any noticeable headache.
      
      Rename cgroup_subsys_state() to cgroup_css() and task_subsys_state()
      to task_css().  This patch is pure rename.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NLi Zefan <lizefan@huawei.com>
      8af01f56
  2. 29 6月, 2013 2 次提交
  3. 20 6月, 2013 2 次提交
  4. 09 6月, 2013 6 次提交
  5. 04 6月, 2013 1 次提交
  6. 01 6月, 2013 1 次提交
  7. 29 5月, 2013 5 次提交
  8. 24 5月, 2013 1 次提交
    • T
      device_cgroup: simplify cgroup tree walk in propagate_exception() · d591fb56
      Tejun Heo 提交于
      During a config change, propagate_exception() needs to traverse the
      subtree to update config on the subtree.  Because such config updates
      need to allocate memory, it couldn't directly use
      cgroup_for_each_descendant_pre() which required the whole iteration to
      be contained in a single RCU read critical section.  To work around
      the limitation, propagate_exception() built a linked list of
      descendant cgroups while read-locking RCU and then walked the list
      afterwards, which is safe as the whole iteration is protected by
      devcgroup_mutex.  This works but is cumbersome.
      
      With the recent updates, cgroup iterators now allow dropping RCU read
      lock while iteration is in progress making this workaround no longer
      necessary.  This patch replaces dev_cgroup->propagate_pending list and
      get_online_devcg() with direct cgroup_for_each_descendant_pre() walk.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Aristeu Rozanski <aris@redhat.com>
      Acked-by: NSerge E. Hallyn <serge.hallyn@ubuntu.com>
      Reviewed-by: NMichal Hocko <mhocko@suse.cz>
      d591fb56
  9. 13 5月, 2013 1 次提交
    • J
      security: cap_inode_getsecctx returning garbage · 0d422afb
      J. Bruce Fields 提交于
      We shouldn't be returning success from this function without also
      filling in the return values ctx and ctxlen.
      
      Note currently this doesn't appear to cause bugs since the only
      inode_getsecctx caller I can find is fs/sysfs/inode.c, which only calls
      this if security_inode_setsecurity succeeds.  Assuming
      security_inode_setsecurity is set to cap_inode_setsecurity whenever
      inode_getsecctx is set to cap_inode_getsecctx, this function can never
      actually called.
      
      So I noticed this only because the server labeled NFS patches add a real
      caller.
      Acked-by: NSerge E. Hallyn <serge.hallyn@ubuntu.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      0d422afb
  10. 12 5月, 2013 1 次提交
  11. 08 5月, 2013 1 次提交
  12. 01 5月, 2013 1 次提交
  13. 30 4月, 2013 1 次提交
  14. 28 4月, 2013 14 次提交