================================================================== BUG: KCSAN: data-race in __count_memcg_events / mem_cgroup_css_rstat_flush read-write to 0xffff888237d344c0 of 4 bytes by task 7227 on cpu 1: memcg_rstat_updated mm/memcontrol.c:725 [inline] __count_memcg_events+0xce/0x130 mm/memcontrol.c:962 mem_cgroup_charge_statistics mm/memcontrol.c:990 [inline] mem_cgroup_commit_charge+0x92/0x200 mm/memcontrol.c:2975 charge_memcg mm/memcontrol.c:7288 [inline] __mem_cgroup_charge+0x75/0x100 mm/memcontrol.c:7299 mem_cgroup_charge include/linux/memcontrol.h:691 [inline] __filemap_add_folio+0xc6/0x6d0 mm/filemap.c:864 filemap_add_folio+0x70/0x160 mm/filemap.c:947 __filemap_get_folio+0x2f1/0x5b0 mm/filemap.c:1934 ext4_da_write_begin+0x2ef/0x550 fs/ext4/inode.c:2885 generic_perform_write+0x1d5/0x410 mm/filemap.c:3974 ext4_buffered_write_iter+0x1f6/0x380 fs/ext4/file.c:299 ext4_file_write_iter+0x29f/0xe30 __kernel_write_iter+0x265/0x490 fs/read_write.c:523 dump_emit_page fs/coredump.c:890 [inline] dump_user_range+0x3a7/0x550 fs/coredump.c:951 elf_core_dump+0x1aa6/0x1bc0 fs/binfmt_elf.c:2077 do_coredump+0x1033/0x1890 fs/coredump.c:764 get_signal+0xdc1/0x1080 kernel/signal.c:2896 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x59/0x130 kernel/entry/common.c:218 do_syscall_64+0xda/0x1d0 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f write to 0xffff888237d344c0 of 4 bytes by task 316 on cpu 0: mem_cgroup_css_rstat_flush+0x4ea/0x540 mm/memcontrol.c:5848 cgroup_rstat_flush_locked+0x848/0x980 kernel/cgroup/rstat.c:245 cgroup_rstat_flush+0x26/0x40 kernel/cgroup/rstat.c:277 do_flush_stats mm/memcontrol.c:745 [inline] flush_memcg_stats_dwork+0x50/0x90 mm/memcontrol.c:782 process_one_work kernel/workqueue.c:3267 [inline] process_scheduled_works+0x465/0x990 kernel/workqueue.c:3348 worker_thread+0x526/0x730 kernel/workqueue.c:3429 kthread+0x1d1/0x210 kernel/kthread.c:388 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 value changed: 0x00000008 -> 0x0000000e Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 316 Comm: kworker/u8:5 Not tainted 6.9.0-rc7-syzkaller-00012-gdccb07f2914c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: events_unbound flush_memcg_stats_dwork ==================================================================