linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Barry Song <21cnbao@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: hailong.liu@oppo.com, akpm@linux-foundation.org,
	urezki@gmail.com,  lstoakes@gmail.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,  xiang@kernel.org, chao@kernel.org,
	Oven <liyangouwen1@oppo.com>
Subject: Re: [RFC PATCH] mm/vmalloc: fix vmalloc which may return null if called with __GFP_NOFAIL
Date: Thu, 9 May 2024 18:12:58 +1200	[thread overview]
Message-ID: <CAGsJ_4wW-Z+H=vZ44AJZEhJA1QXgoBn=mN+JUYJxNCUyAadfog@mail.gmail.com> (raw)
In-Reply-To: <ZjxWkleEdk5iUxI8@infradead.org>

On Thu, May 9, 2024 at 4:52 PM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Thu, May 09, 2024 at 02:20:03PM +1200, Barry Song wrote:
> > reverting the fix intended to address the OOM-killer issue in commit
> > dd544141b9eb.
> > Should we indeed permit the NOFAIL flag for large kvmalloc allocations?
>
> What is large?  When you don't allow actually use cases people will
> just reimplement it poorly.  E.g. we'd probably have to add back the
> XFS kmem_ wrappers.

Xiang gave his number 24KiB in erofs, but probably we still have some
"naughty" users allocating much more than 24KiB with NOFAIL in other
subsystems. We should never return NULL for NOFAIL.  So, in any case,
we require Hailong's patch in some form.

However, commit dd544141b9eb ("vmalloc: back off when the current task is
OOM-killed") is also tackling an issue. If we can find a way to preserve its
benefits even in the NOFAIL scenario, it would be preferable, though it
seems improbable. Thus, I'm considering if we could at least include a
WARN_ON_ONCE((gfp & NOFAIL) && size > LARGE) to aid in debugging
potential issues we might encounter. Furthermore, compelling a large
allocation with NOFAIL also appears pointless, as it could lead to
unpredictable long latency.

But I don't know what the proper "LARGE" value is.

Thanks
Barry


  reply	other threads:[~2024-05-09  6:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08 12:58 hailong.liu
2024-05-08 13:41 ` Gao Xiang
2024-05-08 14:13   ` Gao Xiang
2024-05-08 14:43   ` Hailong Liu
2024-05-08 15:10     ` Gao Xiang
2024-05-08 15:31       ` Hailong Liu
2024-05-08 15:40         ` Gao Xiang
2024-05-09  1:30           ` Hailong Liu
2024-05-09  4:51             ` Christoph Hellwig
2024-05-09  2:20 ` Barry Song
2024-05-09  2:26   ` Barry Song
2024-05-09  2:30     ` Barry Song
2024-05-09  2:39   ` Gao Xiang
2024-05-09  3:09     ` Barry Song
2024-05-09  3:17       ` Gao Xiang
2024-05-09  3:11     ` Gao Xiang
2024-05-09  3:22     ` Hailong Liu
2024-05-09  3:33   ` Hailong Liu
2024-05-09  3:48     ` Barry Song
2024-05-09  4:19       ` Gao Xiang
2024-05-09  4:52   ` Christoph Hellwig
2024-05-09  6:12     ` Barry Song [this message]
2024-05-09  7:48 ` Michal Hocko
2024-05-09  8:06   ` Hailong Liu
2024-05-09  8:32     ` Barry Song
2024-05-09  8:57       ` Barry Song
2024-05-09  9:50         ` Hailong Liu

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='CAGsJ_4wW-Z+H=vZ44AJZEhJA1QXgoBn=mN+JUYJxNCUyAadfog@mail.gmail.com' \
    --to=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chao@kernel.org \
    --cc=hailong.liu@oppo.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liyangouwen1@oppo.com \
    --cc=lstoakes@gmail.com \
    --cc=urezki@gmail.com \
    --cc=xiang@kernel.org \
    /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