Re: iomap_writepages WARN_ON_ONCE(PF_MEMALLOC)
From: Matthew Wilcox
Date: Fri Jul 03 2026 - 20:57:16 EST
On Thu, Jul 02, 2026 at 03:59:24AM -0700, Christoph Hellwig wrote:
> On Wed, Jul 01, 2026 at 10:51:06PM +0200, Andreas Gruenbacher wrote:
> > Do you have any suggestions?
> >
> > The above is on RHEL-8, but a similar code path exists in cgroups v2,
> > triggered via:
> >
> > echo reclaim_amount > /sys/fs/cgroup/.../memory.reclaim
> >
> > That code path starts with:
> >
> > memory_reclaim -> user_proactive_reclaim -> try_to_free_mem_cgroup_pages ->
>
> PF_MEMALLOC is a sign of direct reclaim. cgroup code is doing really
> weird things when it is set and it is doing writeback.
If we're going to blame the cgroup people for doing weird things, let's
cc them so they stand a chance of seeing this ... original at:
https://lore.kernel.org/linux-fsdevel/CAHc6FU4tz8-HmEf2_XKT0NT8N=rv5OMcY79PxTACkXAVLOAUpg@xxxxxxxxxxxxxx/