All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: Wang Wensheng <wsw9603@163.com>,
	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, youngjun.park@lge.com,
	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 13:51:22 +0530	[thread overview]
Message-ID: <03a8646d-eaea-4569-b0ca-ac87d2ffc35a@arm.com> (raw)
In-Reply-To: <20261203142306.468748-2-wsw9603@163.com>



On 03/12/26 7:53 pm, 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

What if a process is doing madvise(MADV_PAGEOUT)? Then you may not be able
to obtain memory by freeing pagecache/slab etc I think?


> 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);
>  
>  	/*
>  	 * Back to atomic context. We might have migrated to a new CPU with a



  parent reply	other threads:[~2026-12-04  8:21 UTC|newest]

Thread overview: 11+ 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
2026-12-04  5:06     ` wangwensheng
2026-12-04  8:21   ` Dev Jain [this message]
2026-12-04 14:24   ` sashiko-bot
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
2026-12-04  9:29       ` Michal Hocko
2026-12-04  9:06   ` Vlastimil Babka (SUSE)

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=03a8646d-eaea-4569-b0ca-ac87d2ffc35a@arm.com \
    --to=dev.jain@arm.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=youngjun.park@lge.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.