sched/core: Fix cpu.max vs. cpuhotplug deadlock
authorPeter Zijlstra <peterz@infradead.org>
Mon, 22 Jan 2018 21:53:28 +0000 (22:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Dec 2018 18:41:17 +0000 (19:41 +0100)
commite5d981df9a1d3f13dfff083ab0578daedbcd9e8a
tree91b388528b45cba3538aee53a5af6f9ed11f7c76
parent72e5a2bdf753f5ba82ea6bfb7706aabc9587d0cb
sched/core: Fix cpu.max vs. cpuhotplug deadlock

commit ce48c146495a1a50e48cdbfbfaba3e708be7c07c upstream

Tejun reported the following cpu-hotplug lock (percpu-rwsem) read recursion:

  tg_set_cfs_bandwidth()
    get_online_cpus()
      cpus_read_lock()

    cfs_bandwidth_usage_inc()
      static_key_slow_inc()
        cpus_read_lock()

Reported-by: Tejun Heo <tj@kernel.org>
Tested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20180122215328.GP3397@worktop
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/jump_label.h
kernel/jump_label.c
kernel/sched/fair.c