All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kiryl Shutsemau <kirill@shutemov.name>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>,
	 Ilya Gladyshev <ilya.gladyshev@linux.dev>,
	Matthew Wilcox <willy@infradead.org>,
	 Lorenzo Stoakes <ljs@kernel.org>,
	Luis Chamberlain <mcgrof@kernel.org>,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>,
	 "Paul E. McKenney" <paulmck@kernel.org>
Subject: Re: Improve page refcount scalability
Date: Mon, 19 Oct 2026 15:16:28 +0100	[thread overview]
Message-ID: <atYk-TcWs056Mz_b@thinkstation> (raw)
In-Reply-To: <CAHk-=wha6UNEv+7nVi9zSxa4p=4K-HNMZqxMR-RcspjPTxYp6g@mail.gmail.com>

On Fri, Oct 16, 2026 at 07:47:48AM -0700, Linus Torvalds wrote:
> On Fri, 16 Oct 2026 at 07:40, Kiryl Shutsemau <kirill@shutemov.name> wrote:
> >
> > I've added a cutoff to the lockless path: if the folio is large and the
> > read covers more than four of its pages, leave it to the slow path,
> > where one reference covers all of them.
> >
> > Sounds reasonable?
> 
> Sounds eminently reasonable to me.

I realized that we don't need to re-lookup the large folio in the xarray
for each index it covers: a large folio is all-or-nothing. If we found it
at one index, it is at all the indexes the folio covers. But we need
*one* more xas_load() per large folio, for the last page we copy: the
folio's size cannot be trusted without a reference, and finding the
folio in that slot proves the range is still its own.

So I dropped the cutoff. 64K reads of one hot folio from 64 threads go
from ~93k to ~1.37M MiB/s on huge tmpfs and from ~572k to ~1.36M MiB/s
on ext4: the cutoff sent them to the slow path. Single-thread large
reads stay at base.

-- 
  Kiryl Shutsemau / Kirill A. Shutemov


  reply	other threads:[~2026-10-19 14:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 18:43 Improve page refcount scalability Linus Torvalds
2026-10-13 21:03 ` Matthew Wilcox
2026-10-13 21:26   ` Linus Torvalds
2026-10-13 23:20   ` Paul E. McKenney
2026-10-14 10:36   ` Kiryl Shutsemau
2026-10-14 10:46     ` David Hildenbrand (Arm)
2026-10-13 22:43 ` Kiryl Shutsemau
2026-10-13 23:39   ` Linus Torvalds
2026-10-14 11:53     ` Kiryl Shutsemau
2026-10-14 15:28       ` Matthew Wilcox
2026-10-14  0:10 ` Harry Yoo
2026-10-14  1:01   ` Linus Torvalds
2026-10-14 13:59     ` Pedro Falcato
2026-10-14 16:25       ` Linus Torvalds
2026-10-14 16:59         ` Linus Torvalds
2026-10-14 17:15           ` Linus Torvalds
2026-10-14 17:43           ` Kirill A. Shutemov
2026-10-14 18:24             ` Linus Torvalds
2026-10-15  2:12               ` Jaegeuk Kim
2026-10-16 14:43                 ` Kiryl Shutsemau
2026-10-16 15:41                   ` Jaegeuk Kim
2026-10-16 14:40 ` Kiryl Shutsemau
2026-10-16 14:47   ` Linus Torvalds
2026-10-19 14:16     ` Kiryl Shutsemau [this message]
2026-10-16 15:14   ` David Hildenbrand (Arm)

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=atYk-TcWs056Mz_b@thinkstation \
    --to=kirill@shutemov.name \
    --cc=david@kernel.org \
    --cc=ilya.gladyshev@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=willy@infradead.org \
    /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.