summaryrefslogtreecommitdiff
path: root/kernel/debug/debug_core.h
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2026-11-14 22:40:28 +0100
committerTejun Heo <tj@kernel.org>2026-11-15 05:34:45 -1000
commit7693e1350b06191143724da742559fb47211348e (patch)
tree5bb9fa17b98e11dbe055d9abeb8e1c46a4ef315c /kernel/debug/debug_core.h
parente234ed1bb82c96a5643fd70784f16cf3d72eeed3 (diff)
memcg: make MEMCG select BLK_CGROUP
Memcg reclaim only relies on writeback throttling if writeback_throttling_sane() does. Since commit 97c9341f7271 ("mm: vmscan: disable memcg direct reclaim stalling if cgroup writeback support is in use") that's the case if the memory controller is on the default hierarchy and CONFIG_CGROUP_WRITEBACK is set. Otherwise shrink_folio_list() sleeps in folio_wait_writeback() for a folio that is under writeback and already marked for reclaim if the allocation may enter the filesystem. CONFIG_CGROUP_WRITEBACK is enabled whenever CONFIG_MEMCG and CONFIG_BLK_CGROUP are. So with CONFIG_MEMCG=y and CONFIG_BLK_CGROUP=n memcg reclaim on cgroup v2 waits for writeback just like it does on cgroup v1. That wait can deadlock against freezing a filesystem. Loop takes freeze protection on the backing filesystem for its writes. A task in the middle of a write() to the backing filesystem holds freeze protection as well. If that task enters memcg reclaim it can end up waiting for writeback of a folio that belongs to a filesystem on the loop device. If a freeze of the backing filesystem is pending the loop worker blocks when it tries to write that folio out. And the freeze waits for the task in reclaim to drop its freeze protection. The same applies to other drivers that serve block I/O by writing to a file on a local filesystem and take freeze protection for it, e.g., the scsi target's fileio backend. Make CONFIG_MEMCG select CONFIG_BLK_CGROUP if CONFIG_BLOCK is set. Then CONFIG_CGROUP_WRITEBACK is always enabled together with memcg and memcg reclaim on cgroup v2 doesn't sleep in folio_wait_writeback() anymore. a Without CONFIG_BLOCK there are no block devices that could deadlock like this. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org> Acked-by: Shakeel Butt <shakeel.butt@linux.dev> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/debug/debug_core.h')
0 files changed, 0 insertions, 0 deletions