mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ehab Ababneh <ehab.ababneh@intel.com>
To: ziy@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: buddy.lumpkin@oracle.com, akpm@linux-foundation.org,
	kasong@tencent.com, qi.zheng@linux.dev, shakeel.butt@linux.dev,
	baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com,
	weixugc@google.com, david@kernel.org, ljs@kernel.org,
	liam@infradead.org, vbabka@kernel.org, rppt@kernel.org,
	surenb@google.com, mhocko@suse.com, jackmanb@google.com,
	hannes@cmpxchg.org, baoquan.he@linux.dev,
	baolin.wang@linux.alibaba.com,
	Ehab Ababneh <ehab.ababneh@intel.com>
Subject: [RFC PATCH v2 5/5] mm/vmscan: scale hopeless threshold for kswapd workers
Date: Fri,  9 Oct 2026 13:33:04 -0700	[thread overview]
Message-ID: <ee792198db686d202c311e05c61cf5f45fcd8d86.1791577417.git.ehab.ababneh@intel.com> (raw)
In-Reply-To: <cover.1791577417.git.ehab.ababneh@intel.com>

The per-node failure counter advances once per worker balance pass
that makes no reclaim progress. With multiple kswapd workers, it can
reach MAX_RECLAIM_RETRIES while others are still reclaiming, marking
the node hopeless prematurely.

Scale the threshold by the active kswapd worker count so each worker
keeps the existing retry budget.

Signed-off-by: Ehab Ababneh <ehab.ababneh@intel.com>
---
 mm/vmscan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 9e051aac2203..61d46a376eb9 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -7940,7 +7940,8 @@ void kswapd_try_clear_hopeless(struct pglist_data *pgdat,
 
 bool kswapd_test_hopeless(pg_data_t *pgdat)
 {
-	return atomic_read(&pgdat->kswapd_failures) >= MAX_RECLAIM_RETRIES;
+	return atomic_read(&pgdat->kswapd_failures) >=
+		MAX_RECLAIM_RETRIES * READ_ONCE(current_kswapds_per_node);
 }
 
 #ifdef CONFIG_HIBERNATION
-- 
2.43.0


  parent reply	other threads:[~2026-10-09 20:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 22:10 [RFC PATCH 0/3] mm/vmscan: adaptive multi-threaded kswapd for NUMA-aware reclaim Ehab Ababneh
2026-09-08 22:10 ` [RFC PATCH 1/3] vmscan: Support multiple kswapd threads per node Ehab Ababneh
2026-09-08 22:10 ` [RFC PATCH 2/3] mm/vmscan: handle racing max_seq advancement Ehab Ababneh
2026-09-08 22:10 ` [RFC PATCH 3/3] mm/vmscan: make kswapd wakeups NUMA load-aware Ehab Ababneh
2026-09-09  2:16 ` [RFC PATCH 0/3] mm/vmscan: adaptive multi-threaded kswapd for NUMA-aware reclaim Zi Yan
2026-09-22 21:23   ` Ababneh, Ehab
2026-10-09 20:32     ` [RFC PATCH v2 0/5] " Ehab Ababneh
2026-10-09 20:33       ` [RFC PATCH v2 1/5] vmscan: Support multiple kswapd threads per node Ehab Ababneh
2026-10-10  8:51         ` Barry Song
2026-10-09 20:33       ` [RFC PATCH v2 2/5] mm/vmscan: silence spurious max_seq race warning Ehab Ababneh
2026-10-09 20:33       ` [RFC PATCH v2 3/5] mm/vmscan: make kswapd wakeups NUMA load-aware Ehab Ababneh
2026-10-09 20:33       ` [RFC PATCH v2 4/5] mm/vmscan: let kswapd scan minimum-generation lruvecs Ehab Ababneh
2026-10-09 20:33       ` Ehab Ababneh [this message]
2026-10-09 20:40       ` [RFC PATCH v2 0/5] mm/vmscan: adaptive multi-threaded kswapd for NUMA-aware reclaim Lorenzo Stoakes (ARM)
2026-10-10  8:19       ` Barry Song
2026-10-14  7:29         ` Ababneh, Ehab

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=ee792198db686d202c311e05c61cf5f45fcd8d86.1791577417.git.ehab.ababneh@intel.com \
    --to=ehab.ababneh@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=baoquan.he@linux.dev \
    --cc=buddy.lumpkin@oracle.com \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=kasong@tencent.com \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=qi.zheng@linux.dev \
    --cc=rppt@kernel.org \
    --cc=shakeel.butt@linux.dev \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=weixugc@google.com \
    --cc=yuanchu@google.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

all inboxes | Powered by JetHome®