BUG: sleeping function called from invalid context at kernel/cgroup/rstat.c:200 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 10, name: kworker/u4:1 3 locks held by kworker/u4:1/10: #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:620 [inline] #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline] #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:617 [inline] #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:644 [inline] #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x871/0x1630 kernel/workqueue.c:2247 #1: ffffc90000cf7db0 (stats_flush_work){+.+.}-{0:0}, at: process_one_work+0x8a5/0x1630 kernel/workqueue.c:2251 #2: ffffffff8bad45d8 (stats_flush_lock){+.+.}-{2:2}, at: spin_trylock include/linux/spinlock.h:369 [inline] #2: ffffffff8bad45d8 (stats_flush_lock){+.+.}-{2:2}, at: mem_cgroup_flush_stats mm/memcontrol.c:5358 [inline] #2: ffffffff8bad45d8 (stats_flush_lock){+.+.}-{2:2}, at: flush_memcg_stats_work+0xd/0x50 mm/memcontrol.c:5373 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 0 PID: 10 Comm: kworker/u4:1 Not tainted 5.14.0-rc1-next-20210716-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events_unbound flush_memcg_stats_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 ___might_sleep.cold+0x1f3/0x239 kernel/sched/core.c:9182 cgroup_rstat_flush+0x1c/0x50 kernel/cgroup/rstat.c:200 mem_cgroup_flush_stats mm/memcontrol.c:5361 [inline] mem_cgroup_flush_stats mm/memcontrol.c:5356 [inline] flush_memcg_stats_work+0x39/0x50 mm/memcontrol.c:5373 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 BUG: sleeping function called from invalid context at kernel/cgroup/rstat.c:200 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 10, name: kworker/u4:1 3 locks held by kworker/u4:1/10: #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0} , at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] , at: atomic64_set include/asm-generic/atomic-instrumented.h:620 [inline] , at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline] , at: set_work_data kernel/workqueue.c:617 [inline] , at: set_work_pool_and_clear_pending kernel/workqueue.c:644 [inline] , at: process_one_work+0x871/0x1630 kernel/workqueue.c:2247 #1: ffffc90000cf7db0 (stats_flush_work){+.+.}-{0:0}, at: process_one_work+0x8a5/0x1630 kernel/workqueue.c:2251 #2: ffffffff8bad45d8 (stats_flush_lock){+.+.}-{2:2}, at: spin_trylock include/linux/spinlock.h:369 [inline] #2: ffffffff8bad45d8 (stats_flush_lock){+.+.}-{2:2}, at: mem_cgroup_flush_stats mm/memcontrol.c:5358 [inline] #2: ffffffff8bad45d8 (stats_flush_lock){+.+.}-{2:2}, at: flush_memcg_stats_work+0xd/0x50 mm/memcontrol.c:5373 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 10 Comm: kworker/u4:1 Tainted: G W 5.14.0-rc1-next-20210716-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events_unbound flush_memcg_stats_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 ___might_sleep.cold+0x1f3/0x239 kernel/sched/core.c:9182 cgroup_rstat_flush+0x1c/0x50 kernel/cgroup/rstat.c:200 mem_cgroup_flush_stats mm/memcontrol.c:5361 [inline] mem_cgroup_flush_stats mm/memcontrol.c:5356 [inline] flush_memcg_stats_work+0x39/0x50 mm/memcontrol.c:5373 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 BUG: sleeping function called from invalid context at kernel/cgroup/rstat.c:200 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 10, name: kworker/u4:1 3 locks held by kworker/u4:1/10: #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:620 [inline] #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline] #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:617 [inline] #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:644 [inline] #0: ffff888010869138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x871/0x1630 kernel/workqueue.c:2247 #1: ffffc90000cf7db0 (stats_flush_work){+.+.}-{0:0}, at: process_one_work+0x8a5/0x1630 kernel/workqueue.c:2251 #2: ffffffff8bad45d8 (stats_flush_lock){+.+.}-{2:2}, at: spin_trylock include/linux/spinlock.h:369 [inline] #2: ffffffff8bad45d8 (stats_flush_lock){+.+.}-{2:2}, at: mem_cgroup_flush_stats mm/memcontrol.c:5358 [inline] #2: ffffffff8bad45d8 (stats_flush_lock){+.+.}-{2:2}, at: flush_memcg_stats_work+0xd/0x50 mm/memcontrol.c:5373 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 10 Comm: kworker/u4:1 Tainted: G W 5.14.0-rc1-next-20210716-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events_unbound flush_memcg_stats_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 ___might_sleep.cold+0x1f3/0x239 kernel/sched/core.c:9182 cgroup_rstat_flush+0x1c/0x50 kernel/cgroup/rstat.c:200 mem_cgroup_flush_stats mm/memcontrol.c:5361 [inline] mem_cgroup_flush_stats mm/memcontrol.c:5356 [inline] flush_memcg_stats_work+0x39/0x50 mm/memcontrol.c:5373 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295