On Mon, 23 Feb 2026, Vishal Moola (Oracle) wrote:

> On Thu, Feb 12, 2026 at 05:33:30PM +0100, Mikulas Patocka wrote:
> > The commit 07003531e03c8 ("mm/vmalloc: warn on invalid vmalloc gfp
> > flags") breaks the device mapper VDO target. The VDO target calls vmalloc
> > with __GFP_RETRY_MAYFAIL and this flag is not in the mask of allowed
> > flags.
> > 
> > There is no reason why vmalloc couldn't support __GFP_RETRY_MAYFAIL, so 
> > let's add this flag to GFP_VMALLOC_SUPPORTED.
> 
> My only skepticism about this comes from the line in the
> vmalloc_node_range() doc: 
> "and %__GFP_RETRY_MAYFAIL are not supported."
> 
> I myself don't know why that may be. Could you elaborate on if/why the
> doc is wrong please?

This statement was added by Michal Hocko in the commit 
b7d90e7a5ea8d64e668d5685925900d33d3884d5. Michal, could you explain why do 
you think that __GFP_RETRY_MAYFAIL is not supported?

The VDO module needs to allocate large amounts of memory and it doesn't 
want to trigger the OOM killer (which would kill some innocent task and 
wouldn't solve the out of memory condition at all), so I think that 
__GFP_RETRY_MAYFAIL is appropriate.

Mikulas

> > Signed-off-by: Mikulas Patocka <[email protected]>
> > Reported-by: Zdenek Kabelac <[email protected]>
> > Fixes: 07003531e03c ("mm/vmalloc: warn on invalid vmalloc gfp flags")
> > Cc: [email protected]  # v6.19
> > 
> > ---
> >  mm/vmalloc.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > Index: linux-2.6/mm/vmalloc.c
> > ===================================================================
> > --- linux-2.6.orig/mm/vmalloc.c
> > +++ linux-2.6/mm/vmalloc.c
> > @@ -3928,6 +3928,7 @@ fail:
> >   */
> >  #define GFP_VMALLOC_SUPPORTED (GFP_KERNEL | GFP_ATOMIC | GFP_NOWAIT |\
> >                             __GFP_NOFAIL |  __GFP_ZERO | __GFP_NORETRY |\
> > +                           __GFP_RETRY_MAYFAIL |\
> >                             GFP_NOFS | GFP_NOIO | GFP_KERNEL_ACCOUNT |\
> >                             GFP_USER | __GFP_NOLOCKDEP)
> >  
> > 
> 


Reply via email to