linux-stable/kernel/cgroup
Tejun Heo d8742e2290 cgroup: css_set_lock should nest inside tasklist_lock
cgroup_enable_task_cg_lists() incorrectly nests non-irq-safe
tasklist_lock inside irq-safe css_set_lock triggering the following
lockdep warning.

  WARNING: possible irq lock inversion dependency detected
  4.17.0-rc1-00027-gb37d049 #6 Not tainted
  --------------------------------------------------------
  systemd/1 just changed the state of lock:
  00000000fe57773b (css_set_lock){..-.}, at: cgroup_free+0xf2/0x12a
  but this lock took another, SOFTIRQ-unsafe lock in the past:
   (tasklist_lock){.+.+}

  and interrupts could create inverse lock ordering between them.

  other info that might help us debug this:
   Possible interrupt unsafe locking scenario:

	 CPU0                    CPU1
	 ----                    ----
    lock(tasklist_lock);
				 local_irq_disable();
				 lock(css_set_lock);
				 lock(tasklist_lock);
    <Interrupt>
      lock(css_set_lock);

   *** DEADLOCK ***

The condition is highly unlikely to actually happen especially given
that the path is executed only once per boot.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Boqun Feng <boqun.feng@gmail.com>
2018-05-23 11:04:54 -07:00
..
cgroup-internal.h cgroup: Factor out and expose cgroup_rstat_*() interface functions 2018-04-26 14:29:05 -07:00
cgroup-v1.c cgroup: Fix deadlock in cpu hotplug path 2017-12-19 05:38:47 -08:00
cgroup.c cgroup: css_set_lock should nest inside tasklist_lock 2018-05-23 11:04:54 -07:00
cpuset.c kernel/cpuset: current_cpuset_is_being_rebound can be boolean 2018-02-06 18:32:47 -08:00
debug.c debug cgroup: use task_css_set instead of rcu_dereference 2017-11-27 11:37:33 -08:00
freezer.c cgroup: add @flags to css_task_iter_start() and implement CSS_TASK_ITER_PROCS 2017-07-21 11:14:51 -04:00
Makefile cgroup: Rename kernel/cgroup/stat.c to kernel/cgroup/rstat.c 2018-04-26 14:29:04 -07:00
namespace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pids.c cgroup: implement cgroup v2 thread support 2017-07-21 11:14:51 -04:00
rdma.c rdmacg: Convert to use match_string() helper 2018-05-07 09:27:26 -07:00
rstat.c cgroup: Make cgroup_rstat_updated() ready for root cgroup usage 2018-04-26 14:29:06 -07:00