From: Kiryl Shutsemau <kirill@shutemov.name>
To: ilya.gladyshev@linux.dev
Cc: ivgorbunov@me.com, Liam.Howlett@oracle.com,
akpm@linux-foundation.org, apopple@nvidia.com,
artem.kuzin@huawei.com, baolin.wang@linux.alibaba.com,
david@kernel.org, foxido@foxido.dev, harry.yoo@oracle.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
lorenzo.stoakes@oracle.com, mhocko@suse.com,
muchun.song@linux.dev, rppt@kernel.org, surenb@google.com,
torvalds@linuxfoundation.org, vbabka@suse.cz,
willy@infradead.org, yuzhao@google.com, ziy@nvidia.com,
pfalcato@suse.de
Subject: Re: [PATCH v3 1/2] mm: drop page refcount zero state semantics
Date: Thu, 4 Jun 2026 12:04:34 +0100 [thread overview]
Message-ID: <aiFZ57eRrCcWmS6E@thinkstation> (raw)
In-Reply-To: <7c28d766b007345f5f31ba9a086a3bffe95a013d@linux.dev>
On Thu, Jun 04, 2026 at 10:15:12AM +0000, ilya.gladyshev@linux.dev wrote:
> @@ -115,8 +120,14 @@ static inline void init_page_count(struct page *page)
> set_page_count(page, 1);
> }
>
> +static inline void set_page_count_as_frozen(struct page *page)
> +{
> + set_page_count(page, 0);
> +}
> +
This name is strange. Maybe something like init_page_count_frozen()?
And don't you want to update it in patch 2 to set the bit?
> static inline void page_ref_add(struct page *page, int nr)
> {
> + VM_BUG_ON(__page_count_is_frozen(page_count(page)));
Hm. These VM_BUG_ONs are useless after patch 2.
In patch 2, you make __page_count_is_frozen() check the frozen bit and
page_count() masks out frozen bit.
I guess you want to read raw ref number here, no?
And why not VM_BUG_ON_PAGE/FOLIO()?
> atomic_add(nr, &page->_refcount);
> if (page_ref_tracepoint_active(page_ref_mod))
> __page_ref_mod(page, nr);
--
Kiryl Shutsemau / Kirill A. Shutemov
next prev parent reply other threads:[~2026-06-04 11:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 10:13 [PATCH v3 0/2] mm: improve folio refcount scalability ilya.gladyshev
2026-06-04 10:15 ` [PATCH v3 1/2] mm: drop page refcount zero state semantics ilya.gladyshev
2026-06-04 11:04 ` Kiryl Shutsemau [this message]
2026-06-04 12:47 ` ilya.gladyshev
2026-06-04 10:15 ` [PATCH v3 2/2] mm: implement page refcount locking via dedicated bit 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=aiFZ57eRrCcWmS6E@thinkstation \
--to=kirill@shutemov.name \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=artem.kuzin@huawei.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@kernel.org \
--cc=foxido@foxido.dev \
--cc=harry.yoo@oracle.com \
--cc=ilya.gladyshev@linux.dev \
--cc=ivgorbunov@me.com \
--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 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.