Re: [PATCH 2/2] mm: introduce PF_MEMALLOC_NOWARN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu 01-02-24 06:03:27, Kent Overstreet wrote:
> On Mon, Jan 29, 2024 at 11:48:00AM +0100, Michal Hocko wrote:
[...]
> >From 0e87e55058ccddde4b6bcc092f43e66a4e632575 Mon Sep 17 00:00:00 2001
> From: Kent Overstreet <kent.overstreet@xxxxxxxxx>
> Date: Thu, 25 Jan 2024 19:00:24 -0500
> Subject: [PATCH] mm: introduce PF_MEMALLOC_NORECLAIM, PF_MEMALLOC_NOWARN
> 
> Introduce PF_MEMALLOC_* equivalents of some GFP_ flags:
> 
> PF_MEMALLOC_NORECLAIM	-> GFP_NOWAIT

scoped NOWAIT/NORECLAIM semantic has been proposed in the past. I
haven't been fan of it TBH. This is really tricky because unlike other
scoped flags this changes the allocation failure semantic for the code
that is not really aware of that. Even worse if the code inside the
scope has a completely different allocation failure requirements - e.g.
consider a nested GFP_NOFAIL request. Your implementation would simply
override that and cause an unexpected failure. Now you could exclude
GFP_NOFAIL explicitly but that brings more problems down the road - e.g.
consider the scope NOWAIT is a way to prevent from sleeping from within
atomic context. Now nested GFP_NOFAIL request either busy waits or
sleeps inside of an atomic context. No good!

-- 
Michal Hocko
SUSE Labs




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux