From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Zi Yan <ziy@nvidia.com>, Linus Torvalds <torvalds@linuxfoundation.org>
Cc: Ilya Gladyshev <ilya.gladyshev@linux.dev>,
akpm@linux-foundation.org, andrew+netdev@lunn.ch,
apopple@nvidia.com, artem.kuzin@huawei.com,
baolin.wang@linux.alibaba.com, 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, vbabka@suse.cz, willy@infradead.org,
yuzhao@google.com
Subject: Re: [PATCH v6 3/3] mm: implement page refcount locking via dedicated bit
Date: Fri, 25 Sep 2026 09:15:06 +0200 [thread overview]
Message-ID: <a2ea9840-bca1-4c69-bc67-e6e27485aac9@kernel.org> (raw)
In-Reply-To: <DLO1WIACYFWF.3N01DXYFJLMD0@nvidia.com>
On 9/25/26 04:44, Zi Yan wrote:
> On Thu Sep 24, 2026 at 4:06 PM EDT, Linus Torvalds wrote:
>> On Thu, 24 Sept 2026 at 11:52, David Hildenbrand (Arm) <david@kernel.org> wrote:
>>>
>>> There needs to be a common page freeing function that dipatches stuff.
>>
>> I think this all needs to be entirely generic to all pages. Agreed.
>> Everybody needs to do it right.
>
> It assumes all callers of page_ref_dec_and_test() are free page
> functions, but there are two exceptions:
Right, we'll have to sort these out. Which is the right thing to do either way :)
>
> 1. compaction_free() uses folio_put_testzero(), which calls
> page_ref_dec_and_test() to put not used migration dst page back to
> isolated freelist instead of freeing them.
>
> 2. virtio_mem_fake_offline_going_offline() drops the last reference of
> fake-offline pages, so that they can be offline.
I had a patch for that, where we keep the refcount untouched:
https://lore.kernel.org/linux-mm/20250520164216.866543-2-david@redhat.com/
Long-term PG_offline pages will not have a refcount at all, and just have a
frozen refcount. That's the right solution long-term: allocate+free them as
frozen in virtio-mem. Needs some more work, though :)
--
Cheers,
David
next prev parent reply other threads:[~2026-09-25 7:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 19:50 [PATCH v6 0/3] mm: improve folio refcount scalability 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-15 2:42 ` Zi Yan
2026-09-23 17:34 ` Ilya Gladyshev
2026-09-24 18:51 ` David Hildenbrand (Arm)
2026-09-24 20:06 ` Linus Torvalds
2026-09-25 2:44 ` Zi Yan
2026-09-25 7:03 ` Ilya Gladyshev
2026-09-25 7:06 ` David Hildenbrand (Arm)
2026-09-25 7:15 ` David Hildenbrand (Arm) [this message]
2026-09-14 0:06 ` [PATCH v6 0/3] mm: improve folio refcount scalability Andrew Morton
2026-09-14 8:10 ` Ilya Gladyshev
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=a2ea9840-bca1-4c69-bc67-e6e27485aac9@kernel.org \
--to=david@kernel.org \
--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=edumazet@google.com \
--cc=harry.yoo@oracle.com \
--cc=hramamurthy@google.com \
--cc=ilya.gladyshev@linux.dev \
--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®