Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Youngjun Park <youngjun.park@lge.com>
To: Wang Wensheng <wsw9603@163.com>
Cc: vbabka@kernel.org, hannes@cmpxchg.org, surenb@google.com,
	mhocko@suse.com, brendan.jackman@linux.dev, ziy@nvidia.com,
	akpm@linux-foundation.org, chrisl@kernel.org, kasong@tencent.com,
	shikemeng@huaweicloud.com, nphamcs@gmail.com,
	baoquan.he@linux.dev, baohua@kernel.org, david@kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH 1/2] mm/swap: Don't warn if swap_cluster_alloc_table() failed
Date: Fri, 4 Dec 2026 11:32:24 +0900	[thread overview]
Message-ID: <axImOPNAQ8yzd64c@yjaykim-PowerEdge-T330> (raw)
In-Reply-To: <20261203142306.468748-2-wsw9603@163.com>

On Thu, Dec 03, 2026 at 10:23:05PM +0800, Wang Wensheng wrote:
> swap_cluster_alloc_table() is mostly used in the memory reclaim path
> and should not warn when memory allocation fails. The actual user may
> reclaim pagecache or slab to free up memory. Even if the user ultimately
> cannot obtain memory, it is more useful to issue the warning at the last
> possible point.
> 
> Signed-off-by: Wang Wensheng <wsw9603@163.com>
> ---
>  mm/swapfile.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 226230dda0aa..b8fc4e25f1f3 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -602,7 +602,7 @@ swap_cluster_populate(struct swap_info_struct *si,
>  	local_unlock(&percpu_swap_cluster.lock);
>  
>  	ret = swap_cluster_alloc_table(si, ci, __GFP_HIGH | __GFP_NOMEMALLOC |
> -					     GFP_KERNEL, false);
> +					     __GFP_NOWARN | GFP_KERNEL, false);

Hi Wensheng,

it may point to a real problem in dynamic cluster allocation, 
so the warning could be useful.

If it is rare, __GFP_NOWARN isn't really needed(not bothering). 
If it is frequent, it suggests a real problem in dynamic cluster allocation, and then
the warning is useful.

IMHO So either way, it seems worth keeping. 
What do you think?

Thanks,
Youngjun


  reply	other threads:[~2026-12-04  2:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 14:23 [PATCH 0/2] Fix spurious warnings about memory allocation Wang Wensheng
2026-12-03 14:23 ` [PATCH 1/2] mm/swap: Don't warn if swap_cluster_alloc_table() failed Wang Wensheng
2026-12-04  2:32   ` Youngjun Park [this message]
2026-12-03 14:23 ` [PATCH 2/2] mm/page_alloc: Move PF_MEMALLOC warning to nopage tag in the slowpath Wang Wensheng
2026-12-03 17:24   ` Michal Hocko
2026-12-04  1:42     ` wangwensheng

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=axImOPNAQ8yzd64c@yjaykim-PowerEdge-T330 \
    --to=youngjun.park@lge.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baoquan.he@linux.dev \
    --cc=brendan.jackman@linux.dev \
    --cc=chrisl@kernel.org \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kasong@tencent.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=nphamcs@gmail.com \
    --cc=shikemeng@huaweicloud.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=wsw9603@163.com \
    --cc=ziy@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