On Mon, Aug 12, 2024 at 7:37 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote: > > On Mon, Aug 12, 2024 at 05:05:24PM +0800, Yafang Shao wrote: > > The PF_MEMALLOC_NORECLAIM flag was introduced in commit eab0af905bfc > > ("mm: introduce PF_MEMALLOC_NORECLAIM, PF_MEMALLOC_NOWARN"). To complement > > this, let's add two helper functions, memalloc_nowait_{save,restore}, which > > will be useful in scenarios where we want to avoid waiting for memory > > reclamation. > > No, forcing nowait on callee contets is just asking for trouble. > Unlike NOIO or NOFS this is incompatible with NOFAIL allocations I don’t see any incompatibility in __alloc_pages_slowpath(). The ~__GFP_DIRECT_RECLAIM flag only ensures that direct reclaim is not performed, but it doesn’t prevent the allocation of pages from ALLOC_MIN_RESERVE, correct? > and thus will lead to kernel crashes. Could you please explain in detail where this might lead to kernel crashes? -- Regards Yafang