From: Andrew Morton <akpm@linux-foundation.org>
To: Rik van Riel <riel@surriel.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, Vinay Banakar <vny@google.com>,
liuye <liuye@kylinos.cn>, Hugh Dickins <hughd@google.com>,
Mel Gorman <mgorman@techsingularity.net>,
Yu Zhao <yuzhao@google.com>,
Shakeel Butt <shakeel.butt@linux.dev>
Subject: Re: [PATCH v2] mm/vmscan: batch TLB flush during memory reclaim
Date: Thu, 3 Apr 2025 15:00:55 -0700 [thread overview]
Message-ID: <20250403150055.94a38bc7e6e3f618fbc23ddd@linux-foundation.org> (raw)
In-Reply-To: <20250328142055.313916d1@fangorn>
On Fri, 28 Mar 2025 14:20:55 -0400 Rik van Riel <riel@surriel.com> wrote:
> The current implementation in shrink_folio_list() performs a full TLB
> flush for every individual folio reclaimed. This causes unnecessary
> overhead during memory reclaim.
>
> The current code:
> 1. Clears PTEs and unmaps each page individually
> 2. Performs a full TLB flush on every CPU the mm is running on
>
> The new code:
> 1. Clears PTEs and unmaps each page individually
> 2. Adds each unmapped page to pageout_folios
> 3. Flushes the TLB once before procesing pageout_folios
>
> This reduces the number of TLB flushes issued by the memory reclaim
> code by 1/N, where N is the number of mapped folios encountered in
> the batch processed by shrink_folio_list.
Were any runtime benefits observable?
next prev parent reply other threads:[~2025-04-03 22:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-28 18:20 Rik van Riel
2025-04-03 22:00 ` Andrew Morton [this message]
2025-04-03 22:31 ` Shakeel Butt
2025-04-04 13:30 ` Vinay Banakar
2025-04-04 13:37 ` Vinay Banakar
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=20250403150055.94a38bc7e6e3f618fbc23ddd@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuye@kylinos.cn \
--cc=mgorman@techsingularity.net \
--cc=riel@surriel.com \
--cc=shakeel.butt@linux.dev \
--cc=vny@google.com \
--cc=yuzhao@google.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