Re: [PATCH v2] memcg: Don't call schedule_work when no spinning is allowed
From: Andrew Morton
Date: Sat Sep 05 2026 - 19:49:59 EST
On Fri, 4 Sep 2026 10:31:45 -0700 David Stevens <stevensd@xxxxxxxxxx> wrote:
> Memcg charging can be done from any context, but calling schedule_work()
> isn't safe from an NMI. If memory.high is breached from a context where
> spinning isn't allowed, use irq_work to schedule the reclaim work.
>
> Fixes: 3ac4638a734a ("memcg: make memcg_rstat_updated nmi safe")
Thanks.
To fill in the desirable statement of user impact, I pasted this from
the v1 thread:
: Found this via code inspection. I spent a little bit trying to trigger it
: for real, but the only way I managed was by writing a hacky driver absuing
: alloc_pages_nolock().