From: Linus Torvalds <torvalds@linuxfoundation.org>
To: Pedro Falcato <pfalcato@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Gladyshev Ilya <gladyshev.ilya1@h-partners.com>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Zi Yan <ziy@nvidia.com>,
Harry Yoo <harry.yoo@oracle.com>,
Matthew Wilcox <willy@infradead.org>,
Yu Zhao <yuzhao@google.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Alistair Popple <apopple@nvidia.com>,
Gorbunov Ivan <gorbunov.ivan@h-partners.com>,
Muchun Song <muchun.song@linux.dev>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Kiryl Shutsemau <kirill@shutemov.name>,
Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH 0/1] mm: improve folio refcount scalability
Date: Sun, 1 Mar 2026 13:16:01 -0800 [thread overview]
Message-ID: <CAHk-=whWnAqw+2YZ=LHs5C6ecGSLqgi+DxtJJ_p06rZsnosVKA@mail.gmail.com> (raw)
In-Reply-To: <m73zmq6jbdzqmxdjgnmfmd5h4w5a2khur7we3e64r357o32hfj@mvwcqgnuhzqh>
On Sun, 1 Mar 2026 at 12:26, Pedro Falcato <pfalcato@suse.de> wrote:
>
> Here we can see that the optimistic cmpxchg still can't match the xadd/lock addl
> performance in single-thread, and degrades quickly and worse than straight up
> cmpxchg under load (perhaps presumably because of the cmpxchg miss).
Ok, thanks for doing the numbers. I'm (obviously) a bit surprised at
how badly cmpxchg does - it used to be noticeably worse than "lock
add" even for the non-contention case, but I thought that had long
since been fixed.
Clearly that's just not the case - and I had just been overly
optimistic that the "first cmpxchg failed, but second one gets the
value without losing the cacheline in between" would work reliably.
Ho humm. Maybe that "locked" flag is the best we can do.
Linus
prev parent reply other threads:[~2026-03-01 21:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 16:27 Gladyshev Ilya
2026-02-26 16:27 ` [PATCH 1/1] mm: implement page refcount locking via dedicated bit Gladyshev Ilya
2026-02-28 22:19 ` [PATCH 0/1] mm: improve folio refcount scalability Andrew Morton
2026-03-01 3:27 ` Linus Torvalds
2026-03-01 18:52 ` Linus Torvalds
2026-03-01 20:26 ` Pedro Falcato
2026-03-01 21:16 ` Linus Torvalds [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='CAHk-=whWnAqw+2YZ=LHs5C6ecGSLqgi+DxtJJ_p06rZsnosVKA@mail.gmail.com' \
--to=torvalds@linuxfoundation.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@fromorbit.com \
--cc=david@kernel.org \
--cc=gladyshev.ilya1@h-partners.com \
--cc=gorbunov.ivan@h-partners.com \
--cc=harry.yoo@oracle.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=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