From: Shivank Garg <shivankg@amd.com>
To: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Kairui Song <kasong@tencent.com>,
Qi Zheng <qi.zheng@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
Barry Song <baohua@kernel.org>,
Axel Rasmussen <axelrasmussen@google.com>,
Yuanchu Xie <yuanchu@google.com>, Wei Xu <weixugc@google.com>,
Baoquan He <baoquan.he@linux.dev>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Jan Kara <jack@suse.cz>, Hugh Dickins <hughd@google.com>,
Rik van Riel <riel@surriel.com>, Harry Yoo <harry@kernel.org>,
Jann Horn <jannh@google.com>, Lance Yang <lance.yang@linux.dev>,
Chris Li <chrisl@kernel.org>,
Kemeng Shi <shikemeng@huaweicloud.com>,
Nhat Pham <nphamcs@gmail.com>,
Youngjun Park <youngjun.park@lge.com>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
"Michal Hocko" <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
"Muchun Song" <muchun.song@linux.dev>,
Uladzislau Rezki <urezki@gmail.com>, SJ Park <sj@kernel.org>,
Minchan Kim <minchan@kernel.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Alexander Potapenko <glider@google.com>,
"Marco Elver" <elver@google.com>,
Dmitry Vyukov <dvyukov@google.com>,
Pedro Falcato <pfalcato@suse.de>, Bharata B Rao <bharata@amd.com>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
<linux-fsdevel@vger.kernel.org>, <cgroups@vger.kernel.org>,
<bpf@vger.kernel.org>, <damon@lists.linux.dev>,
<kasan-dev@googlegroups.com>, Shivank Garg <shivankg@amd.com>
Subject: [PATCH 2/8] mm: remove unused folio refcount helpers
Date: Mon, 26 Oct 2026 10:30:30 +0000 [thread overview]
Message-ID: <20261026-unused-sym-v1-2-82ca2dceabe1@amd.com> (raw)
In-Reply-To: <20261026-unused-sym-v1-0-82ca2dceabe1@amd.com>
folio_ref_sub_return(), folio_ref_inc_return(), folio_ref_dec_and_test()
and folio_ref_dec_return() have no callers. The last
folio_ref_sub_return() user was removed in commit 38607c62b34b
("fs/dax: properly refcount fs dax pages").
Signed-off-by: Shivank Garg <shivankg@amd.com>
---
include/linux/page_ref.h | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/include/linux/page_ref.h b/include/linux/page_ref.h
index 9f5c75d06f76..6fc20a49fa84 100644
--- a/include/linux/page_ref.h
+++ b/include/linux/page_ref.h
@@ -157,15 +157,6 @@ static inline void folio_ref_sub(struct folio *folio, int nr)
page_ref_sub(&folio->page, nr);
}
-static inline int folio_ref_sub_return(struct folio *folio, int nr)
-{
- int ret = atomic_sub_return(nr, &folio->_refcount);
-
- if (page_ref_tracepoint_active(page_ref_mod_and_return))
- __page_ref_mod_and_return(&folio->page, -nr, ret);
- return ret;
-}
-
static inline void page_ref_inc(struct page *page)
{
atomic_inc(&page->_refcount);
@@ -213,11 +204,6 @@ static inline int page_ref_inc_return(struct page *page)
return ret;
}
-static inline int folio_ref_inc_return(struct folio *folio)
-{
- return page_ref_inc_return(&folio->page);
-}
-
static inline int page_ref_dec_and_test(struct page *page)
{
int ret = atomic_dec_and_test(&page->_refcount);
@@ -227,11 +213,6 @@ static inline int page_ref_dec_and_test(struct page *page)
return ret;
}
-static inline int folio_ref_dec_and_test(struct folio *folio)
-{
- return page_ref_dec_and_test(&folio->page);
-}
-
static inline int page_ref_dec_return(struct page *page)
{
int ret = atomic_dec_return(&page->_refcount);
@@ -241,11 +222,6 @@ static inline int page_ref_dec_return(struct page *page)
return ret;
}
-static inline int folio_ref_dec_return(struct folio *folio)
-{
- return page_ref_dec_return(&folio->page);
-}
-
static inline bool page_ref_add_unless_zero(struct page *page, int nr)
{
bool ret = atomic_add_unless(&page->_refcount, nr, 0);
--
2.53.0
next prev parent reply other threads:[~2026-10-26 10:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 10:30 [PATCH 0/8] mm: remove unused functions Shivank Garg
2026-10-26 10:30 ` [PATCH 1/8] mm/vmstat: remove unused folio stat helpers Shivank Garg
2026-10-26 10:30 ` Shivank Garg [this message]
2026-10-26 10:30 ` [PATCH 3/8] mm/page_ext: remove unused page_ext_iter_get() Shivank Garg
2026-10-26 10:30 ` [PATCH 4/8] mm: remove unused helpers from pagemap.h Shivank Garg
2026-10-26 10:30 ` [PATCH 5/8] mm/swapops: remove unused make_guard_swp_entry() Shivank Garg
2026-10-26 10:30 ` [PATCH 6/8] mm/swap: remove unused folio_to_swp_tb() Shivank Garg
2026-10-26 10:30 ` [PATCH 7/8] mm/zsmalloc: remove unused zpdesc_lock() Shivank Garg
2026-10-26 10:30 ` [PATCH 8/8] mm: nommu: remove unused heap_stack_gap Shivank Garg
2026-10-26 10:32 ` [PATCH 0/8] mm: remove unused functions David Hildenbrand (Arm)
2026-10-26 11:14 ` Garg, Shivank
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=20261026-unused-sym-v1-2-82ca2dceabe1@amd.com \
--to=shivankg@amd.com \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=baoquan.he@linux.dev \
--cc=bharata@amd.com \
--cc=bpf@vger.kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=chrisl@kernel.org \
--cc=corbet@lwn.net \
--cc=damon@lists.linux.dev \
--cc=david@kernel.org \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=hannes@cmpxchg.org \
--cc=harry@kernel.org \
--cc=hughd@google.com \
--cc=jack@suse.cz \
--cc=jannh@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kasong@tencent.com \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=minchan@kernel.org \
--cc=muchun.song@linux.dev \
--cc=nphamcs@gmail.com \
--cc=pfalcato@suse.de \
--cc=qi.zheng@linux.dev \
--cc=riel@surriel.com \
--cc=roman.gushchin@linux.dev \
--cc=rppt@kernel.org \
--cc=senozhatsky@chromium.org \
--cc=shakeel.butt@linux.dev \
--cc=shikemeng@huaweicloud.com \
--cc=sj@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=surenb@google.com \
--cc=urezki@gmail.com \
--cc=vbabka@kernel.org \
--cc=weixugc@google.com \
--cc=willy@infradead.org \
--cc=youngjun.park@lge.com \
--cc=yuanchu@google.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®