LKML Archive on
help / color / mirror / Atom feed
From: Johannes Weiner <>
To: Andrew Morton <>
Cc: Rik van Riel <>,,,
Subject: [PATCH] mm: vmscan: fix missing psi annotation for node_reclaim()
Date: Wed, 18 Aug 2021 11:24:57 -0400	[thread overview]
Message-ID: <> (raw)

In a debugging session the other day, Rik noticed that node_reclaim()
was missing memstall annotations. This means we'll miss pressure and
lost productivity resulting from reclaim on an overloaded local NUMA
node when vm.zone_reclaim_mode is enabled.

There haven't been any reports, but that's likely because
vm.zone_reclaim_mode hasn't been a commonly used feature recently, and
the intersection between such setups and psi users is probably
nil. Although, secondary memory such as CXL-connected DIMMS,
persistent memory etc. and the page demotion patches that handle them
could soon make this a more common codepath again.

Reported-by: Rik van Riel <>
Signed-off-by: Johannes Weiner <>
 mm/vmscan.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 701106e1829c..8ec4412c6116 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4424,11 +4424,13 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in
 		.may_swap = 1,
 		.reclaim_idx = gfp_zone(gfp_mask),
+	unsigned long pflags;
 	trace_mm_vmscan_node_reclaim_begin(pgdat->node_id, order,
+	psi_memstall_enter(&pflags);
 	 * We need to be able to allocate from the reserves for RECLAIM_UNMAP
@@ -4453,6 +4455,7 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in
 	current->flags &= ~PF_SWAPWRITE;
+	psi_memstall_leave(&pflags);

             reply	other threads:[~2021-08-18 15:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 15:24 Johannes Weiner [this message]
2021-08-19 15:04 ` Shakeel Butt

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] mm: vmscan: fix missing psi annotation for node_reclaim()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).