Skip to content
  1. Apr 12, 2013
  2. Apr 10, 2013
    • Tejun Heo's avatar
      perf: make perf_event cgroup hierarchical · ef824fa1
      Tejun Heo authored
      
      
      perf_event is one of a couple remaining cgroup controllers with broken
      hierarchy support.  Converting it to support hierarchy is almost
      trivial.  The only thing necessary is to consider a task belonging to
      a descendant cgroup as a match.  IOW, if the cgroup of the currently
      executing task (@cpuctx->cgrp) equals or is a descendant of the
      event's cgroup (@event->cgrp), then the event should be enabled.
      
      Implement hierarchy support and remove .broken_hierarchy tag along
      with the incorrect comment on what needs to be done for hierarchy
      support.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      ef824fa1
    • Li Zefan's avatar
      cgroup: implement cgroup_is_descendant() · 78574cf9
      Li Zefan authored
      
      
      A couple controllers want to determine whether two cgroups are in
      ancestor/descendant relationship.  As it's more likely that the
      descendant is the primary subject of interest and there are other
      operations focusing on the descendants, let's ask is_descendent rather
      than is_ancestor.
      
      Implementation is trivial as the previous patch guarantees that all
      ancestors of a cgroup stay accessible as long as the cgroup is
      accessible.
      
      tj: Removed depth optimization, renamed from cgroup_is_ancestor(),
          rewrote descriptions.
      
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      78574cf9
    • Li Zefan's avatar
      cgroup: make sure parent won't be destroyed before its children · 415cf07a
      Li Zefan authored
      
      
      Suppose we rmdir a cgroup and there're still css refs, this cgroup won't
      be freed. Then we rmdir the parent cgroup, and the parent is freed
      immediately due to css ref draining to 0. Now it would be a disaster if
      the still-alive child cgroup tries to access its parent.
      
      Make sure this won't happen.
      
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      Reviewed-by: default avatarMichal Hocko <mhocko@suse.cz>
      Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      415cf07a
    • Rami Rosen's avatar
      cgroup: remove bind() method from cgroup_subsys. · 84cfb6ab
      Rami Rosen authored
      
      
      The bind() method of cgroup_subsys is not used in any of the
      controllers (cpuset, freezer, blkio, net_cls, memcg, net_prio,
      devices, perf, hugetlb, cpu and cpuacct)
      
      tj: Removed the entry on ->bind() from
          Documentation/cgroups/cgroups.txt.  Also updated a couple
          paragraphs which were suggesting that dynamic re-binding may be
          implemented.  It's not gonna.
      
      Signed-off-by: default avatarRami Rosen <ramirose@gmail.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      84cfb6ab
  3. Apr 07, 2013
  4. Apr 03, 2013
  5. Mar 20, 2013
  6. Mar 12, 2013
  7. Mar 05, 2013
  8. Mar 04, 2013
    • Li Zefan's avatar
      cgroup: no need to check css refs for release notification · f50daa70
      Li Zefan authored
      
      
      We no longer fail rmdir() when there're still css refs, so we don't
      need to check css refs in check_for_release().
      
      This also voids a bug. cgroup_has_css_refs() accesses subsys[i]
      without cgroup_mutex, so it can race with cgroup_unload_subsys().
      
      cgroup_has_css_refs()
      ...
        if (ss == NULL || ss->root != cgrp->root)
      
      if ss pointers to net_cls_subsys, and cls_cgroup module is unloaded
      right after the former check but before the latter, the memory that
      net_cls_subsys resides has become invalid.
      
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      f50daa70
    • Li Zefan's avatar
      cpuset: use cgroup_name() in cpuset_print_task_mems_allowed() · f440d98f
      Li Zefan authored
      
      
      Use cgroup_name() instead of cgrp->dentry->name. This makes the code
      a bit simpler.
      
      While at it, remove cpuset_name and make cpuset_nodelist a local variable
      to cpuset_print_task_mems_allowed().
      
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      f440d98f
    • Li Zefan's avatar
      cgroup: fix cgroup_path() vs rename() race · 65dff759
      Li Zefan authored
      
      
      rename() will change dentry->d_name. The result of this race can
      be worse than seeing partially rewritten name, but we might access
      a stale pointer because rename() will re-allocate memory to hold
      a longer name.
      
      As accessing dentry->name must be protected by dentry->d_lock or
      parent inode's i_mutex, while on the other hand cgroup-path() can
      be called with some irq-safe spinlocks held, we can't generate
      cgroup path using dentry->d_name.
      
      Alternatively we make a copy of dentry->d_name and save it in
      cgrp->name when a cgroup is created, and update cgrp->name at
      rename().
      
      v5: use flexible array instead of zero-size array.
      v4: - allocate root_cgroup_name and all root_cgroup->name points to it.
          - add cgroup_name() wrapper.
      v3: use kfree_rcu() instead of synchronize_rcu() in user-visible path.
      v2: make cgrp->name RCU safe.
      
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      65dff759
  9. Mar 03, 2013
  10. Mar 02, 2013
    • James Hogan's avatar
      trace/ring_buffer: handle 64bit aligned structs · 649508f6
      James Hogan authored
      
      
      Some 32 bit architectures require 64 bit values to be aligned (for
      example Meta which has 64 bit read/write instructions). These require 8
      byte alignment of event data too, so use
      !CONFIG_HAVE_64BIT_ALIGNED_ACCESS instead of !CONFIG_64BIT ||
      CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to decide alignment, and align
      buffer_data_page::data accordingly.
      
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Acked-by: Steven Rostedt <rostedt@goodmis.org> (previous version subtly different)
      649508f6
    • Vincent's avatar
      kdb: Remove unhandled ssb command · 36dfea42
      Vincent authored
      
      
      The 'ssb' command can only be handled when we have a disassembler, to check for
      branches, so remove the 'ssb' command for now.
      
      Signed-off-by: default avatarVincent Stehlé <vincent.stehle@laposte.net>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      36dfea42
    • Jason Wessel's avatar
      kdb: Prevent kernel oops with kdb_defcmd · a37372f6
      Jason Wessel authored
      
      
      The kdb_defcmd can only be used to display the available command aliases
      while using the kernel debug shell.  If you try to define a new macro
      while the kernel debugger is active it will oops.  The debug shell
      macros must use pre-allocated memory set aside at the time kdb_init()
      is run, and the kdb_defcmd is restricted to only working at the time
      that the kdb_init sequence is being run, which only occurs if you
      actually activate the kernel debugger.
      
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      a37372f6
    • Jason Wessel's avatar
      kdb: Remove the ll command · 1b2caa2d
      Jason Wessel authored
      
      
      Recently some code inspection was done after fixing a problem with
      kmalloc used while in the kernel debugger context (which is not
      legal), and it turned up the fact that kdb ll command will oops the
      kernel.
      
      Given that there have been zero bug reports on the command combined
      with the fact it will oops the kernel it is clearly not being used.
      Instead of fixing it, it will be removed.
      
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      1b2caa2d
    • Jason Wessel's avatar
      kdb_main: fix help print · 074604af
      Jason Wessel authored
      
      
      The help command was chopping all the usage instructions such that
      they were not readable.
      
      Example:
      
      bta             [D|R|S|T|C|Z|E|U|I| Backtrace all processes matching state flag
      per_cpu         <sym> [<bytes>] [<c Display per_cpu variables
      
      Where as it should look like:
      
      bta             [D|R|S|T|C|Z|E|U|I|M|A]
                                          Backtrace all processes matching state flag
      per_cpu         <sym> [<bytes>] [<cpu>]
                                          Display per_cpu variables
      
      All that is needed is to check the how long the cmd_usage is and jump
      to the next line when appropriate.
      
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      074604af
    • Jason Wessel's avatar
      kdb: Fix overlap in buffers with strcpy · 4eb7a66d
      Jason Wessel authored
      
      
      Maxime reported that strcpy(s->usage, s->usage+1) has no definitive
      guarantee that it will work on all archs the same way when you have
      overlapping memory.  The fix is simple for the kdb code because we
      still have the original string memory in the function scope, so we
      just have to use that as the argument instead.
      
      Reported-by: default avatarMaxime Villard <rustyBSD@gmx.fr>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      4eb7a66d
    • Matt Klein's avatar
      kdb: Setup basic kdb state before invoking commands via kgdb · 00370b8f
      Matt Klein authored
      
      
      Although invasive kdb commands are not supported via kgdb, some useful
      non-invasive commands like bt* require basic kdb state to be setup before
      calling into the kdb code. Factor out some of this code and call it before
      and after executing kdb commands via kgdb.
      
      Signed-off-by: default avatarMatt Klein <mklein@twitter.com>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      00370b8f
    • Sasha Levin's avatar
      5f784f79
    • John Blackwood's avatar
      kdb: A fix for kdb command table expansion · f7c82d5a
      John Blackwood authored
      
      
      When locally adding in some additional kdb commands, I stumbled
      across an issue with the dynamic expansion of the kdb command table.
      When the number of kdb commands exceeds the size of the statically
      allocated kdb_base_commands[] array, additional space is allocated in
      the kdb_register_repeat() routine.
      
      The unused portion of the newly allocated array was not being initialized
      to zero properly and this would result in segfaults when help '?' was
      executed or when a search for a non-existing command would traverse the
      command table beyond the end of valid command entries and then attempt
      to use the non-zeroed area as actual command entries.
      
      Signed-off-by: default avatarJohn Blackwood <john.blackwood@ccur.com>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      f7c82d5a
  11. Feb 28, 2013
Loading