Re: [syzbot] [mm?] WARNING in mas_nomem

"Liam R. Howlett" <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.kernel.mm
Message-ID <znowjptiinhpf6soj2egyrfcva6acr5dumpjiif43xq6haeypb@v6i4thhxjvpr>
On 26/08/07 04:26PM, Jason Gunthorpe wrote:
> On Fri, Aug 07, 2026 at 03:24:24PM -0400, Liam R. Howlett wrote:
> > On 26/08/07 09:19AM, Liam R. Howlett wrote:
> > > On 26/08/06 12:48PM, Jason Gunthorpe wrote:
> > > > On Thu, Aug 06, 2026 at 10:29:27AM -0400, Liam R. Howlett wrote:
> > > > 
> > > > > @@ -5609,8 +5612,7 @@ void *mas_store(struct ma_state *mas, void *entry)
> > > > >  		goto store;
> > > > >  
> > > > >  	mas_alloc_nodes(mas, GFP_NOWAIT);
> > > > > -	if (mas_is_err(mas))
> > > > > -		return NULL;
> > > > > +	mas_nomem(mas, GFP_KERNEL | __GFP_NOFAIL);
> > > > 
> > > > It still feels really weird to ignore the return code from mas_nomem..
> > > > 
> > > >  void mas_nomem_nofail() 
> > > 
> > > Sure, that's fair.
> > > 
> > > > 
> > > > ? and maybe it can have a WARN_ON
> > > 
> > > 
> > > The warning would never trigger.  If the allocation fails with nofail,
> > > then you'd never reach the warning.
> > 
> > Upon rereading my reply, I don't think it was clear what's going to
> > happen here.
> > 
> > If there's really no memory and no reserves, then we're going to panic
> > on trying to allocate.  So, even if I rewrite this to have a void
> > function to print a warning, it will never trigger, at that point why
> > have another function?  Are you looking to document what's happening in
> > the code with this?  If so, maybe a comment would be better.
> 
> Yeah, it is clearer to document it with a function that can't be
> called wrong, IMHO

Okay, I'll figure out how to do that later.  I'd like to get this in for
the next weeks -next testing as we're getting late in the cycle.

Cheers,
Liam
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.