mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilya Gladyshev" <ilya.gladyshev@linux.dev>
To: "Andrew Morton" <akpm@linux-foundation.org>
Cc: andrew+netdev@lunn.ch, apopple@nvidia.com,
	artem.kuzin@huawei.com, baolin.wang@linux.alibaba.com,
	david@kernel.org, Liam.Howlett@oracle.com, edumazet@google.com,
	harry.yoo@oracle.com, hramamurthy@google.com, ivgorbunov@me.com,
	joshwash@google.com, kirill@shutemov.name,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	lorenzo.stoakes@oracle.com, mhocko@suse.com,
	muchun.song@linux.dev, pfalcato@suse.de, rppt@kernel.org,
	surenb@google.com, torvalds@linuxfoundation.org, vbabka@suse.cz,
	willy@infradead.org, yuzhao@google.com, ziy@nvidia.com,
	ilya.gladyshev@linux.dev
Subject: Re: [PATCH v6 0/3] mm: improve folio refcount scalability
Date: Mon, 14 Sep 2026 08:10:52 +0000	[thread overview]
Message-ID: <9af33e1222c6836df1039eb42b6c0f0514e6f0f4@linux.dev> (raw)
In-Reply-To: <20260913170615.cd43348e579d8dde5d556fb8@linux-foundation.org>

On 9/14/26 03:06, Andrew Morton wrote:
> On Sat, 12 Sep 2026 22:50:07 +0300 Ilya Gladyshev <ilya.gladyshev@linux.dev> wrote:
> >> From: Gladyshev Ilya <ilya.gladyshev@linux.dev>
>>
>> Recap
>> -----
>>
>> This patchset addresses a scalability issue of a folio's add_unless() operation,
>> noticeable during contended IO reads from the same page [folio_try_get()]. The
>> main idea is to replace CAS loop with optimistic increment (and deal with
>> failure later). This requires splitting refcount into counter and separate
>> "dead/frozen" bit.
>>
>> To allow for such modification, this patchset also slightly refactors page_ref
>> API, consolidating all implementation logic inside mm headers. For more
>> information, check individual commit messages. The original performance issue
>> and previous attempts by other people can be found in [1][2].
>>
>> Performance
>> -----------
>>
>> To my regret, I don't have any access to high-core CPUs that I can
>> benchmark on, and a 12 vcpu laptop isn't really a scalability test. So,
>> here I can only paste my previous measurements on Linux 6.15. To be fair,
>> none of the related code paths really changed, so I don't expect any changes in the
>> numbers here.
>
> From a quick eyeballing, this patchset seems to provide performance
> gains which are similar to Kiryl's ill-fated "mm/filemap: Implement
> fast short reads" [2].  Is that accurate?

Yes, since both patches aim to optimize the same refcount CAS contention, just in
different ways. This patch is probably less scalable than Kiryl's seqlock because
there is still refcount cache-line bouncing. That said, I haven't analyzed the code
deeply, and the benchmark numbers are very simular.

>> [1]: https://lore.kernel.org/linux-mm/CAHk-=wj00-nGmXEkxY=-=Z_qP6kiGUziSFvxHJ9N-cLWry5zpA@mail.gmail.com/
>> [2]: https://lore.kernel.org/linux-mm/20251017141536.577466-1-kirill@shutemov.name/
>> [3]: https://lore.kernel.org/all/aqAIFV4nOGPbWiDS@thinkstation/
>

      reply	other threads:[~2026-09-14  8:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12 19:50 Ilya Gladyshev
2026-09-12 19:50 ` [PATCH v6 1/3] gve: reduce pagecnt_bias to USHRT_MAX Ilya Gladyshev
2026-09-12 19:50 ` [PATCH v6 2/3] mm: drop page refcount zero state semantics Ilya Gladyshev
2026-09-14  9:13   ` Kiryl Shutsemau
2026-09-12 19:50 ` [PATCH v6 3/3] mm: implement page refcount locking via dedicated bit Ilya Gladyshev
2026-09-14 10:39   ` Kiryl Shutsemau
2026-09-14  0:06 ` [PATCH v6 0/3] mm: improve folio refcount scalability Andrew Morton
2026-09-14  8:10   ` Ilya Gladyshev [this message]

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=9af33e1222c6836df1039eb42b6c0f0514e6f0f4@linux.dev \
    --to=ilya.gladyshev@linux.dev \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=apopple@nvidia.com \
    --cc=artem.kuzin@huawei.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@kernel.org \
    --cc=edumazet@google.com \
    --cc=harry.yoo@oracle.com \
    --cc=hramamurthy@google.com \
    --cc=ivgorbunov@me.com \
    --cc=joshwash@google.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=pfalcato@suse.de \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=torvalds@linuxfoundation.org \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    --cc=yuzhao@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®