linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Vinay Banakar <vny@google.com>
Cc: SeongJae Park <sj@kernel.org>, Bharata B Rao <bharata@amd.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, mgorman@suse.de,
	Wei Xu <weixugc@google.com>, Greg Thelen <gthelen@google.com>
Subject: Re: [PATCH] mm: Optimize TLB flushes during page reclaim
Date: Thu, 23 Jan 2025 18:17:23 +0000	[thread overview]
Message-ID: <Z5KHs8bY8qt6GW60@casper.infradead.org> (raw)
In-Reply-To: <CALf+9Ye+yuntf0V7SN03kYExdGBkUNRVuLKxY83oB-AKAcJ90w@mail.gmail.com>

On Thu, Jan 23, 2025 at 11:11:13AM -0600, Vinay Banakar wrote:
> Another option would be to modify shrink_folio_list() to force batch
> flushes for up to N pages (512) at a time, rather than relying on
> callers to do the batching via folio_list.

If you really want to improve performance, consider converting
shrink_folio_list() to take a folio_batch.  I did this for
page freeing:
https://lore.kernel.org/all/20240227174254.710559-1-willy@infradead.org/
and we did in fact see a regression (due to shrinking the batch size
from 32 to 15).  We then increased the batch size from 15 to 31 and
saw a 12.5% performance improvement on the page_fault2 benchmark
over the original batch size of 32.  Commit 9cecde80aae0 and
https://lore.kernel.org/oe-lkp/202403151058.7048f6a8-oliver.sang@intel.com/
have some more details.

I think you should be able to see a noticable improvement by going from
a list with 512 entries on it to a batch of 31 entries.


  parent reply	other threads:[~2025-01-23 18:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-20 22:47 Vinay Banakar
2025-01-21  0:05 ` Vinay Banakar
2025-01-22  8:59   ` Bharata B Rao
2025-01-22 11:09     ` Vinay Banakar
2025-01-22 11:31       ` Bharata B Rao
2025-01-22 13:28         ` Vinay Banakar
2025-01-22 20:05           ` SeongJae Park
2025-01-23 17:11             ` Vinay Banakar
2025-01-23 17:23               ` SeongJae Park
2025-01-23 18:17               ` Matthew Wilcox [this message]
2025-01-21  1:43 ` Byungchul Park
2025-01-21 18:03   ` Vinay Banakar
2025-01-23  4:17 ` Rik van Riel
2025-01-23 19:16   ` Vinay Banakar
2025-01-28 22:01     ` Rik van Riel
2025-03-17 19:20     ` Rik van Riel

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=Z5KHs8bY8qt6GW60@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=bharata@amd.com \
    --cc=gthelen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=sj@kernel.org \
    --cc=vny@google.com \
    --cc=weixugc@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