[PATCH 5.10 0/4] cgroup: Fix suspicious rcu_dereference_check() warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ovidiu Panait <ovidiu.panait@xxxxxxxxxxxxx>

When booting the 5.10-stable kernel on the zcu102 board with
CONFIG_PROVE_RCU=y, the following warning is present:
=============================
WARNING: suspicious RCU usage
5.10.194-yocto-standard #1 Not tainted
-----------------------------
include/linux/cgroup.h:495 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

rcu_scheduler_active = 2, debug_locks = 1
9 locks held by kworker/2:2/106:
 #0: ffffff8800048948 ((wq_completion)events){..}-{0:0}, at: process_one_work+0x1f8/0x634
 #1: ffffffc014c4bda8 (deferred_probe_work){..}-{0:0}, at: process_one_work+0x1f8/0x634
 #2: ffffff880005d9a0 (&dev->mutex){....}-{3:3}, at: __device_attach+0x40/0x1c0
 #3: ffffffc011c70cb0 (cpu_hotplug_lock){++++}-{0:0}, at: cpus_read_lock+0x18/0x24
 #4: ffffff8800b10928 (subsys mutex#5){..}-{3:3}, at: subsys_interface_register+0x58/0x120
 #5: ffffff8805e78c00 (&policy->rwsem){..}-{3:3}, at: cpufreq_online+0x590/0x960
 #6: ffffffc012a9e770 (cpuset_mutex){..}-{3:3}, at: cpuset_lock+0x24/0x30
 #7: ffffff880567bd80 (&p->pi_lock){..}-{2:2}, at: task_rq_lock+0x44/0xf0
 #8: ffffff887aff50d8 (&rq->lock){..}-{2:2}, at: task_rq_lock+0x5c/0xf0

stack backtrace:
CPU: 2 PID: 106 Comm: kworker/2:2 Not tainted 5.10.194-yocto-standard #1
Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
Workqueue: events deferred_probe_work_func
Call trace:
 dump_backtrace+0x0/0x1a4
 show_stack+0x20/0x2c
 dump_stack+0xf0/0x13c
 lockdep_rcu_suspicious+0xe4/0xf8
 inc_dl_tasks_cs+0xb8/0xbc
 switched_to_dl+0x38/0x280
 __sched_setscheduler+0x204/0x860
 sched_setattr_nocheck+0x20/0x30
 sugov_init+0x1b8/0x380
 cpufreq_init_governor.part.0+0x60/0xe0
 cpufreq_set_policy+0x1d0/0x33c
 cpufreq_online+0x35c/0x960
 cpufreq_add_dev+0x8c/0xa0
 subsys_interface_register+0x10c/0x120
 cpufreq_register_driver+0x148/0x2a4
 dt_cpufreq_probe+0x288/0x3d0
 platform_drv_probe+0x5c/0xb0
 really_probe+0xe0/0x4ac
 driver_probe_device+0x60/0xf4
 __device_attach_driver+0xc0/0x12c
 bus_for_each_drv+0x80/0xe0
 __device_attach+0xb0/0x1c0
 device_initial_probe+0x1c/0x30
 bus_probe_device+0xa8/0xb0
 deferred_probe_work_func+0x94/0xd0
 process_one_work+0x2b8/0x634
 worker_thread+0x7c/0x474
 kthread+0x154/0x160
 ret_from_fork+0x10/0x34

The warning was introduced in v5.10.193 by commit:
5ac05ce56843 "(sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets)"

This issue was also reported for 5.15 here:
https://lore.kernel.org/lkml/CA+G9fYv9xTu4bKJGy=e=KZSG5pZ+tJAmfZr=0dbuKNs=9OOKhA@xxxxxxxxxxxxxx/

Backport commit f2aa197e4794 ("cgroup: Fix suspicious rcu_dereference_check()
usage warning") and its dependencies to get rid of this warning.

Andrey Ryabinin (1):
  sched/cpuacct: Fix user/system in shown cpuacct.usage*

Chengming Zhou (3):
  sched/cpuacct: Fix charge percpu cpuusage
  sched/cpuacct: Optimize away RCU read lock
  cgroup: Fix suspicious rcu_dereference_check() usage warning

 include/linux/cgroup.h |  3 +-
 kernel/sched/cpuacct.c | 84 +++++++++++++++++-------------------------
 2 files changed, 35 insertions(+), 52 deletions(-)

-- 
2.31.1




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux