From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Shay Drory <shayd@nvidia.com>, linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/core: Silence oversized kvmalloc() warning
Date: Thu, 3 Apr 2025 13:30:32 +0300 [thread overview]
Message-ID: <20250403103032.GH84568@unreal> (raw)
In-Reply-To: <20250401163504.GA325092@nvidia.com>
On Tue, Apr 01, 2025 at 01:35:04PM -0300, Jason Gunthorpe wrote:
> On Mon, Mar 31, 2025 at 10:04:05PM +0300, Leon Romanovsky wrote:
> >
> >
> > On Mon, Mar 31, 2025, at 20:45, Jason Gunthorpe wrote:
> > > On Wed, Mar 26, 2025 at 12:58:54PM +0200, Leon Romanovsky wrote:
> > >> On Wed, Mar 19, 2025 at 02:23:49PM -0300, Jason Gunthorpe wrote:
> > >> > On Wed, Mar 19, 2025 at 02:42:21PM +0200, Leon Romanovsky wrote:
> > >> > > From: Shay Drory <shayd@nvidia.com>
> > >> > >
> > >> > > syzkaller triggered an oversized kvmalloc() warning.
> > >> > > Silence it by adding __GFP_NOWARN.
> > >> >
> > >> > I don't think GFP_NOWARN is the right thing..
> > >> >
> > >> > We've hit this before and I think we ended up adding a size limit
> > >> > check prior to the kvmalloc to prevent the overflow triggered warning.
> > >>
> > >> The size check was needed before this commit was merged:
> > >> 0708a0afe291 ("mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls")
> > >>
> > >> From that point, the correct solution is simply provide __GFP_NOWARN flag.
> > >
> > > I'm not sure, NOWARN removes all warnings, even normal OOM warnings
> > > from regually sized allocations which we don't want to remove.
> >
> > I disagree, this allocation is called from user space. We can safely
> > skip OOM messages and error here will be enough.
>
> That is not the standard, we OOM splat on all userspace allocations
> too.
>
> GFP_NOWARN is supposed to be used in cases where the OOM has a
> recovery and nothing will fail.
NULL returned back to the user is best way to recover.
>
> I think the right thing here is to limit the size, though I'm not
> really sure what the limit should be.
And I still think that NOWARN is the best solution here.
Thanks
>
> Jason
next prev parent reply other threads:[~2025-04-03 10:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 12:42 [PATCH rdma-next] RDMA/core: Silence oversized kvmalloc() warning Leon Romanovsky
2025-03-19 17:23 ` Jason Gunthorpe
2025-03-26 10:58 ` Leon Romanovsky
2025-03-31 17:45 ` Jason Gunthorpe
2025-03-31 19:04 ` Leon Romanovsky
2025-04-01 16:35 ` Jason Gunthorpe
2025-04-03 10:30 ` Leon Romanovsky [this message]
2025-04-09 18:32 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250403103032.GH84568@unreal \
--to=leon@kernel.org \
--cc=jgg@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=shayd@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox