* [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h
2026-11-17 7:16 [PATCH mm-new v2 0/5] mm: remove unused functions Shivank Garg
@ 2026-11-17 7:16 ` Shivank Garg
2026-11-17 10:01 ` Barry Song
` (3 more replies)
2026-11-17 7:16 ` [PATCH mm-new v2 2/5] mm/swapops: remove unused make_guard_swp_entry() Shivank Garg
` (4 subsequent siblings)
5 siblings, 4 replies; 31+ messages in thread
From: Shivank Garg @ 2026-11-17 7:16 UTC (permalink / raw)
To: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Barry Song,
Youngjun Park, Minchan Kim, Sergey Senozhatsky, Liam R. Howlett,
Lorenzo Stoakes, Vlastimil Babka, Jann Horn, Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel, Shivank Garg
invalidate_remote_inode() lost its last user in commit d73065e60dcc
("afs: Use alternative invalidation to using launder_folio").
mapping_clear_release_always() has no callers.
Signed-off-by: Shivank Garg <shivankg@amd.com>
---
include/linux/pagemap.h | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 73af18a37367..e681a7ba6642 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -20,12 +20,6 @@ struct folio_batch;
unsigned long invalidate_mapping_pages(struct address_space *mapping,
pgoff_t start, pgoff_t end);
-static inline void invalidate_remote_inode(struct inode *inode)
-{
- if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
- S_ISLNK(inode->i_mode))
- invalidate_mapping_pages(inode->i_mapping, 0, -1);
-}
int invalidate_inode_pages2(struct address_space *mapping);
int invalidate_inode_pages2_range(struct address_space *mapping,
pgoff_t start, pgoff_t end);
@@ -298,11 +292,6 @@ static inline void mapping_set_release_always(struct address_space *mapping)
set_bit(AS_RELEASE_ALWAYS, &mapping->flags);
}
-static inline void mapping_clear_release_always(struct address_space *mapping)
-{
- clear_bit(AS_RELEASE_ALWAYS, &mapping->flags);
-}
-
static inline bool mapping_stable_writes(const struct address_space *mapping)
{
return test_bit(AS_STABLE_WRITES, &mapping->flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h
2026-11-17 7:16 ` [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h Shivank Garg
@ 2026-11-17 10:01 ` Barry Song
2026-11-18 16:11 ` Dev Jain
` (2 subsequent siblings)
3 siblings, 0 replies; 31+ messages in thread
From: Barry Song @ 2026-11-17 10:01 UTC (permalink / raw)
To: Shivank Garg
Cc: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Youngjun Park,
Minchan Kim, Sergey Senozhatsky, Liam R. Howlett, Lorenzo Stoakes,
Vlastimil Babka, Jann Horn, Pedro Falcato, linux-fsdevel,
linux-mm, linux-kernel
On Tue, Nov 17, 2026 at 3:17 PM Shivank Garg <shivankg@amd.com> wrote:
>
> invalidate_remote_inode() lost its last user in commit d73065e60dcc
> ("afs: Use alternative invalidation to using launder_folio").
> mapping_clear_release_always() has no callers.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
Reviewed-by: Barry Song <baohua@kernel.org>
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h
2026-11-17 7:16 ` [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h Shivank Garg
2026-11-17 10:01 ` Barry Song
@ 2026-11-18 16:11 ` Dev Jain
2026-11-19 4:31 ` Dev Jain
2026-11-19 5:21 ` Garg, Shivank
2026-11-19 5:35 ` + mm-remove-unused-helpers-from-pagemaph.patch added to mm-nonmm-unstable branch Andrew Morton
3 siblings, 1 reply; 31+ messages in thread
From: Dev Jain @ 2026-11-18 16:11 UTC (permalink / raw)
To: Shivank Garg, Matthew Wilcox (Oracle), Jan Kara, Andrew Morton,
Chris Li, Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He,
Barry Song, Youngjun Park, Minchan Kim, Sergey Senozhatsky,
Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn,
Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel
On 17/11/26 12:46 pm, Shivank Garg wrote:
> invalidate_remote_inode() lost its last user in commit d73065e60dcc
> ("afs: Use alternative invalidation to using launder_folio").
> mapping_clear_release_always() has no callers.
That was added in b4fa966f03b7401ceacd4ffd7227197afb2b8376.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
Reviewed-by: Dev Jain <dev.jain@arm.com>
> include/linux/pagemap.h | 11 -----------
> 1 file changed, 11 deletions(-)
>
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 73af18a37367..e681a7ba6642 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -20,12 +20,6 @@ struct folio_batch;
> unsigned long invalidate_mapping_pages(struct address_space *mapping,
> pgoff_t start, pgoff_t end);
>
> -static inline void invalidate_remote_inode(struct inode *inode)
> -{
> - if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
> - S_ISLNK(inode->i_mode))
> - invalidate_mapping_pages(inode->i_mapping, 0, -1);
> -}
> int invalidate_inode_pages2(struct address_space *mapping);
> int invalidate_inode_pages2_range(struct address_space *mapping,
> pgoff_t start, pgoff_t end);
> @@ -298,11 +292,6 @@ static inline void mapping_set_release_always(struct address_space *mapping)
> set_bit(AS_RELEASE_ALWAYS, &mapping->flags);
> }
>
> -static inline void mapping_clear_release_always(struct address_space *mapping)
> -{
> - clear_bit(AS_RELEASE_ALWAYS, &mapping->flags);
> -}
> -
> static inline bool mapping_stable_writes(const struct address_space *mapping)
> {
> return test_bit(AS_STABLE_WRITES, &mapping->flags);
>
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h
2026-11-18 16:11 ` Dev Jain
@ 2026-11-19 4:31 ` Dev Jain
0 siblings, 0 replies; 31+ messages in thread
From: Dev Jain @ 2026-11-19 4:31 UTC (permalink / raw)
To: Shivank Garg, Matthew Wilcox (Oracle), Jan Kara, Andrew Morton,
Chris Li, Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He,
Barry Song, Youngjun Park, Minchan Kim, Sergey Senozhatsky,
Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn,
Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel
On 18/11/26 9:41 pm, Dev Jain wrote:
>
>
> On 17/11/26 12:46 pm, Shivank Garg wrote:
>> invalidate_remote_inode() lost its last user in commit d73065e60dcc
>> ("afs: Use alternative invalidation to using launder_folio").
>> mapping_clear_release_always() has no callers.
>
> That was added in b4fa966f03b7401ceacd4ffd7227197afb2b8376.
>
>>
>> Signed-off-by: Shivank Garg <shivankg@amd.com>
>> ---
>
> Reviewed-by: Dev Jain <dev.jain@arm.com>
... with the commit message improved.
>
>
>> include/linux/pagemap.h | 11 -----------
>> 1 file changed, 11 deletions(-)
>>
>> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
>> index 73af18a37367..e681a7ba6642 100644
>> --- a/include/linux/pagemap.h
>> +++ b/include/linux/pagemap.h
>> @@ -20,12 +20,6 @@ struct folio_batch;
>> unsigned long invalidate_mapping_pages(struct address_space *mapping,
>> pgoff_t start, pgoff_t end);
>>
>> -static inline void invalidate_remote_inode(struct inode *inode)
>> -{
>> - if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
>> - S_ISLNK(inode->i_mode))
>> - invalidate_mapping_pages(inode->i_mapping, 0, -1);
>> -}
>> int invalidate_inode_pages2(struct address_space *mapping);
>> int invalidate_inode_pages2_range(struct address_space *mapping,
>> pgoff_t start, pgoff_t end);
>> @@ -298,11 +292,6 @@ static inline void mapping_set_release_always(struct address_space *mapping)
>> set_bit(AS_RELEASE_ALWAYS, &mapping->flags);
>> }
>>
>> -static inline void mapping_clear_release_always(struct address_space *mapping)
>> -{
>> - clear_bit(AS_RELEASE_ALWAYS, &mapping->flags);
>> -}
>> -
>> static inline bool mapping_stable_writes(const struct address_space *mapping)
>> {
>> return test_bit(AS_STABLE_WRITES, &mapping->flags);
>>
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h
2026-11-17 7:16 ` [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h Shivank Garg
2026-11-17 10:01 ` Barry Song
2026-11-18 16:11 ` Dev Jain
@ 2026-11-19 5:21 ` Garg, Shivank
2026-11-19 5:35 ` + mm-remove-unused-helpers-from-pagemaph.patch added to mm-nonmm-unstable branch Andrew Morton
3 siblings, 0 replies; 31+ messages in thread
From: Garg, Shivank @ 2026-11-19 5:21 UTC (permalink / raw)
To: pfalcato@suse.de, nphamcs@gmail.com, chrisl@kernel.org,
shikemeng@huaweicloud.com, vbabka@kernel.org, willy@infradead.org,
akpm@linux-foundation.org, youngjun.park@lge.com, jack@suse.cz,
minchan@kernel.org, baohua@kernel.org, liam@infradead.org,
kasong@tencent.com, jannh@google.com, ljs@kernel.org,
baoquan.he@linux.dev, senozhatsky@chromium.org
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
On Tue, 2026-11-17 at 07:16 +0000, Shivank Garg wrote:
> invalidate_remote_inode() lost its last user in commit d73065e60dcc
> ("afs: Use alternative invalidation to using launder_folio").
> mapping_clear_release_always() has no callers.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
> include/linux/pagemap.h | 11 -----------
> 1 file changed, 11 deletions(-)
>
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 73af18a37367..e681a7ba6642 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -20,12 +20,6 @@ struct folio_batch;
> unsigned long invalidate_mapping_pages(struct address_space *mapping,
> pgoff_t start, pgoff_t end);
>
> -static inline void invalidate_remote_inode(struct inode *inode)
> -{
> - if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
> - S_ISLNK(inode->i_mode))
> - invalidate_mapping_pages(inode->i_mapping, 0, -1);
> -}
> int invalidate_inode_pages2(struct address_space *mapping);
> int invalidate_inode_pages2_range(struct address_space *mapping,
> pgoff_t start, pgoff_t end);
> @@ -298,11 +292,6 @@ static inline void mapping_set_release_always(struct address_space *mapping)
> set_bit(AS_RELEASE_ALWAYS, &mapping->flags);
> }
>
> -static inline void mapping_clear_release_always(struct address_space *mapping)
> -{
> - clear_bit(AS_RELEASE_ALWAYS, &mapping->flags);
> -}
> -
> static inline bool mapping_stable_writes(const struct address_space *mapping)
> {
> return test_bit(AS_STABLE_WRITES, &mapping->flags);
Hi Willy,
I checked now that MAINTAINERS lists for pagemap.h to your tree
git://git.infradead.org/users/willy/pagecache.git
Rest of this series files go through Andrew's tree.
What would you prefer: should I send this patch separately, rebased on your
tree, or is it fine to keep it in this series for Andrew to pick up?
As suggested by Dev, additional info to fold into commit:
mapping_clear_release_always() was added in b4fa966f03b7 ("mm, netfs,
fscache: stop read optimisation when folio removed from pagecache") and
never had a caller. Earlier version of had called it from ->evict_inode()
but V4 dropped those calls as unnecessary [1] leaving the helper.
[1] https://lore.kernel.org/all/166924370539.1772793.13730698360771821317.stgit@warthog.procyon.org.uk
Thanks,
Shivank
^ permalink raw reply [flat|nested] 31+ messages in thread* + mm-remove-unused-helpers-from-pagemaph.patch added to mm-nonmm-unstable branch
2026-11-17 7:16 ` [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h Shivank Garg
` (2 preceding siblings ...)
2026-11-19 5:21 ` Garg, Shivank
@ 2026-11-19 5:35 ` Andrew Morton
3 siblings, 0 replies; 31+ messages in thread
From: Andrew Morton @ 2026-11-19 5:35 UTC (permalink / raw)
To: mm-commits, youngjun.park, willy, vbabka, shikemeng, senozhatsky,
pfalcato, nphamcs, minchan, ljs, liam, kasong, jannh, jack,
dev.jain, chrisl, baoquan.he, baohua, shivankg, akpm
The patch titled
Subject: mm: remove unused helpers from pagemap.h
has been added to the -mm mm-nonmm-unstable branch. Its filename is
mm-remove-unused-helpers-from-pagemaph.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-remove-unused-helpers-from-pagemaph.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Shivank Garg <shivankg@amd.com>
Subject: mm: remove unused helpers from pagemap.h
Date: Tue, 17 Nov 2026 07:16:48 +0000
Patch series "mm: remove unused functions", v2.
This series removes five functions and one variable in mm that have no
users left anywhere in the tree. I found them with the kunused scripts
[1], which I wrote with LLM's help. The v1 cover letter [2] has more
details on the scripts and how LLM was used.
This patch (of 5):
invalidate_remote_inode() lost its last user in commit d73065e60dcc
("afs: Use alternative invalidation to using launder_folio").
mapping_clear_release_always() has no callers.
Link: https://lore.kernel.org/20261117-unused-sym-mm-v2-0-2f845e94dd50@amd.com
Link: https://patch.msgid.link/20261117-unused-sym-mm-v2-1-2f845e94dd50@amd.com
Link: https://github.com/AMDESE/linux-mm/tree/shivank/kunused [1]
Link: https://lore.kernel.org/r/20261026-unused-sym-v1-0-82ca2dceabe1@amd.com [2]
Signed-off-by: Shivank Garg <shivankg@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Christopher Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Youngjun Park <youngjun.park@lge.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
include/linux/pagemap.h | 11 -----------
1 file changed, 11 deletions(-)
--- a/include/linux/pagemap.h~mm-remove-unused-helpers-from-pagemaph
+++ a/include/linux/pagemap.h
@@ -20,12 +20,6 @@ struct folio_batch;
unsigned long invalidate_mapping_pages(struct address_space *mapping,
pgoff_t start, pgoff_t end);
-static inline void invalidate_remote_inode(struct inode *inode)
-{
- if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
- S_ISLNK(inode->i_mode))
- invalidate_mapping_pages(inode->i_mapping, 0, -1);
-}
int invalidate_inode_pages2(struct address_space *mapping);
int invalidate_inode_pages2_range(struct address_space *mapping,
pgoff_t start, pgoff_t end);
@@ -298,11 +292,6 @@ static inline void mapping_set_release_a
set_bit(AS_RELEASE_ALWAYS, &mapping->flags);
}
-static inline void mapping_clear_release_always(struct address_space *mapping)
-{
- clear_bit(AS_RELEASE_ALWAYS, &mapping->flags);
-}
-
static inline bool mapping_stable_writes(const struct address_space *mapping)
{
return test_bit(AS_STABLE_WRITES, &mapping->flags);
_
Patches currently in -mm which might be from shivankg@amd.com are
mm-remove-unused-helpers-from-pagemaph.patch
mm-swapops-remove-unused-make_guard_swp_entry.patch
mm-swap-remove-unused-folio_to_swp_tb.patch
mm-zsmalloc-remove-unused-zpdesc_lock.patch
mm-nommu-remove-unused-heap_stack_gap.patch
^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH mm-new v2 2/5] mm/swapops: remove unused make_guard_swp_entry()
2026-11-17 7:16 [PATCH mm-new v2 0/5] mm: remove unused functions Shivank Garg
2026-11-17 7:16 ` [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h Shivank Garg
@ 2026-11-17 7:16 ` Shivank Garg
2026-11-17 10:02 ` Barry Song
` (3 more replies)
2026-11-17 7:16 ` [PATCH mm-new v2 3/5] mm/swap: remove unused folio_to_swp_tb() Shivank Garg
` (3 subsequent siblings)
5 siblings, 4 replies; 31+ messages in thread
From: Shivank Garg @ 2026-11-17 7:16 UTC (permalink / raw)
To: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Barry Song,
Youngjun Park, Minchan Kim, Sergey Senozhatsky, Liam R. Howlett,
Lorenzo Stoakes, Vlastimil Babka, Jann Horn, Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel, Shivank Garg
make_guard_swp_entry() has no callers.
Signed-off-by: Shivank Garg <shivankg@amd.com>
---
include/linux/swapops.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index 603f9e3f909c..6f62fc3c8cfa 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -306,11 +306,6 @@ static inline swp_entry_t make_poisoned_swp_entry(void)
return make_pte_marker_entry(PTE_MARKER_POISONED);
}
-static inline swp_entry_t make_guard_swp_entry(void)
-{
- return make_pte_marker_entry(PTE_MARKER_GUARD);
-}
-
struct page_vma_mapped_walk;
#ifdef CONFIG_ARCH_HAS_PMD_SOFTLEAVES
--
2.53.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 2/5] mm/swapops: remove unused make_guard_swp_entry()
2026-11-17 7:16 ` [PATCH mm-new v2 2/5] mm/swapops: remove unused make_guard_swp_entry() Shivank Garg
@ 2026-11-17 10:02 ` Barry Song
2026-11-19 4:32 ` Dev Jain
` (2 subsequent siblings)
3 siblings, 0 replies; 31+ messages in thread
From: Barry Song @ 2026-11-17 10:02 UTC (permalink / raw)
To: Shivank Garg
Cc: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Youngjun Park,
Minchan Kim, Sergey Senozhatsky, Liam R. Howlett, Lorenzo Stoakes,
Vlastimil Babka, Jann Horn, Pedro Falcato, linux-fsdevel,
linux-mm, linux-kernel
On Tue, Nov 17, 2026 at 3:17 PM Shivank Garg <shivankg@amd.com> wrote:
>
> make_guard_swp_entry() has no callers.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
> include/linux/swapops.h | 5 -----
> 1 file changed, 5 deletions(-)
>
Reviewed-by: Barry Song <baohua@kernel.org>
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 2/5] mm/swapops: remove unused make_guard_swp_entry()
2026-11-17 7:16 ` [PATCH mm-new v2 2/5] mm/swapops: remove unused make_guard_swp_entry() Shivank Garg
2026-11-17 10:02 ` Barry Song
@ 2026-11-19 4:32 ` Dev Jain
2026-11-19 5:23 ` Garg, Shivank
2026-11-19 5:35 ` + mm-swapops-remove-unused-make_guard_swp_entry.patch added to mm-nonmm-unstable branch Andrew Morton
3 siblings, 0 replies; 31+ messages in thread
From: Dev Jain @ 2026-11-19 4:32 UTC (permalink / raw)
To: Shivank Garg, Matthew Wilcox (Oracle), Jan Kara, Andrew Morton,
Chris Li, Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He,
Barry Song, Youngjun Park, Minchan Kim, Sergey Senozhatsky,
Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn,
Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel
On 17/11/26 12:46 pm, Shivank Garg wrote:
> make_guard_swp_entry() has no callers.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
With the commit message improved:
Reviewed-by: Dev Jain <dev.jain@arm.com>
> include/linux/swapops.h | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/include/linux/swapops.h b/include/linux/swapops.h
> index 603f9e3f909c..6f62fc3c8cfa 100644
> --- a/include/linux/swapops.h
> +++ b/include/linux/swapops.h
> @@ -306,11 +306,6 @@ static inline swp_entry_t make_poisoned_swp_entry(void)
> return make_pte_marker_entry(PTE_MARKER_POISONED);
> }
>
> -static inline swp_entry_t make_guard_swp_entry(void)
> -{
> - return make_pte_marker_entry(PTE_MARKER_GUARD);
> -}
> -
> struct page_vma_mapped_walk;
>
> #ifdef CONFIG_ARCH_HAS_PMD_SOFTLEAVES
>
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 2/5] mm/swapops: remove unused make_guard_swp_entry()
2026-11-17 7:16 ` [PATCH mm-new v2 2/5] mm/swapops: remove unused make_guard_swp_entry() Shivank Garg
2026-11-17 10:02 ` Barry Song
2026-11-19 4:32 ` Dev Jain
@ 2026-11-19 5:23 ` Garg, Shivank
2026-11-19 5:35 ` + mm-swapops-remove-unused-make_guard_swp_entry.patch added to mm-nonmm-unstable branch Andrew Morton
3 siblings, 0 replies; 31+ messages in thread
From: Garg, Shivank @ 2026-11-19 5:23 UTC (permalink / raw)
To: pfalcato@suse.de, nphamcs@gmail.com, chrisl@kernel.org,
shikemeng@huaweicloud.com, vbabka@kernel.org, willy@infradead.org,
akpm@linux-foundation.org, youngjun.park@lge.com, jack@suse.cz,
minchan@kernel.org, baohua@kernel.org, liam@infradead.org,
kasong@tencent.com, jannh@google.com, ljs@kernel.org,
baoquan.he@linux.dev, senozhatsky@chromium.org
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
On Tue, 2026-11-17 at 07:16 +0000, Shivank Garg wrote:
> make_guard_swp_entry() has no callers.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
> include/linux/swapops.h | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/include/linux/swapops.h b/include/linux/swapops.h
> index 603f9e3f909c..6f62fc3c8cfa 100644
> --- a/include/linux/swapops.h
> +++ b/include/linux/swapops.h
> @@ -306,11 +306,6 @@ static inline swp_entry_t make_poisoned_swp_entry(void)
> return make_pte_marker_entry(PTE_MARKER_POISONED);
> }
>
> -static inline swp_entry_t make_guard_swp_entry(void)
> -{
> - return make_pte_marker_entry(PTE_MARKER_GUARD);
> -}
> -
> struct page_vma_mapped_walk;
>
> #ifdef CONFIG_ARCH_HAS_PMD_SOFTLEAVES
Hi Andrew,
Please fold this additional info to commit as suggested by Dev:
make_guard_swp_entry() was added in 7c53dfbdb024 ("mm: add PTE_MARKER_GUARD
PTE marker"), has never had a caller, and none has been posted in 2 years.
If you prefer, I can send V3 with updated commit text.
Thanks,
Shivank
^ permalink raw reply [flat|nested] 31+ messages in thread* + mm-swapops-remove-unused-make_guard_swp_entry.patch added to mm-nonmm-unstable branch
2026-11-17 7:16 ` [PATCH mm-new v2 2/5] mm/swapops: remove unused make_guard_swp_entry() Shivank Garg
` (2 preceding siblings ...)
2026-11-19 5:23 ` Garg, Shivank
@ 2026-11-19 5:35 ` Andrew Morton
3 siblings, 0 replies; 31+ messages in thread
From: Andrew Morton @ 2026-11-19 5:35 UTC (permalink / raw)
To: mm-commits, youngjun.park, willy, vbabka, shikemeng, senozhatsky,
pfalcato, nphamcs, minchan, ljs, liam, kasong, jannh, jack,
dev.jain, chrisl, baoquan.he, baohua, shivankg, akpm
The patch titled
Subject: mm/swapops: remove unused make_guard_swp_entry()
has been added to the -mm mm-nonmm-unstable branch. Its filename is
mm-swapops-remove-unused-make_guard_swp_entry.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-swapops-remove-unused-make_guard_swp_entry.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Shivank Garg <shivankg@amd.com>
Subject: mm/swapops: remove unused make_guard_swp_entry()
Date: Tue, 17 Nov 2026 07:16:49 +0000
make_guard_swp_entry() was added in 7c53dfbdb024 ("mm: add
PTE_MARKER_GUARD PTE marker"), has never had a caller, and none has
been posted in 2 years.
Link: https://patch.msgid.link/20261117-unused-sym-mm-v2-2-2f845e94dd50@amd.com
Signed-off-by: Shivank Garg <shivankg@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Christopher Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Youngjun Park <youngjun.park@lge.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
include/linux/swapops.h | 5 -----
1 file changed, 5 deletions(-)
--- a/include/linux/swapops.h~mm-swapops-remove-unused-make_guard_swp_entry
+++ a/include/linux/swapops.h
@@ -306,11 +306,6 @@ static inline swp_entry_t make_poisoned_
return make_pte_marker_entry(PTE_MARKER_POISONED);
}
-static inline swp_entry_t make_guard_swp_entry(void)
-{
- return make_pte_marker_entry(PTE_MARKER_GUARD);
-}
-
struct page_vma_mapped_walk;
#ifdef CONFIG_ARCH_HAS_PMD_SOFTLEAVES
_
Patches currently in -mm which might be from shivankg@amd.com are
mm-remove-unused-helpers-from-pagemaph.patch
mm-swapops-remove-unused-make_guard_swp_entry.patch
mm-swap-remove-unused-folio_to_swp_tb.patch
mm-zsmalloc-remove-unused-zpdesc_lock.patch
mm-nommu-remove-unused-heap_stack_gap.patch
^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH mm-new v2 3/5] mm/swap: remove unused folio_to_swp_tb()
2026-11-17 7:16 [PATCH mm-new v2 0/5] mm: remove unused functions Shivank Garg
2026-11-17 7:16 ` [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h Shivank Garg
2026-11-17 7:16 ` [PATCH mm-new v2 2/5] mm/swapops: remove unused make_guard_swp_entry() Shivank Garg
@ 2026-11-17 7:16 ` Shivank Garg
2026-11-17 10:03 ` Barry Song
` (3 more replies)
2026-11-17 7:16 ` [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock() Shivank Garg
` (2 subsequent siblings)
5 siblings, 4 replies; 31+ messages in thread
From: Shivank Garg @ 2026-11-17 7:16 UTC (permalink / raw)
To: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Barry Song,
Youngjun Park, Minchan Kim, Sergey Senozhatsky, Liam R. Howlett,
Lorenzo Stoakes, Vlastimil Babka, Jann Horn, Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel, Shivank Garg
Its last users were removed in commit 0d6af9bcf383 ("mm, swap: use the
swap table to track the swap count").
Signed-off-by: Shivank Garg <shivankg@amd.com>
---
mm/swap_table.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/mm/swap_table.h b/mm/swap_table.h
index 072625d60d54..022d2251884e 100644
--- a/mm/swap_table.h
+++ b/mm/swap_table.h
@@ -135,11 +135,6 @@ static inline unsigned long pfn_to_swp_tb(unsigned long pfn, unsigned char flags
return swp_tb | __flags_to_swp_tb(flags);
}
-static inline unsigned long folio_to_swp_tb(struct folio *folio, unsigned char flags)
-{
- return pfn_to_swp_tb(folio_pfn(folio), flags);
-}
-
static inline unsigned long shadow_to_swp_tb(void *shadow, unsigned char flags)
{
BUILD_BUG_ON((BITS_PER_XA_VALUE + 1) !=
--
2.53.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 3/5] mm/swap: remove unused folio_to_swp_tb()
2026-11-17 7:16 ` [PATCH mm-new v2 3/5] mm/swap: remove unused folio_to_swp_tb() Shivank Garg
@ 2026-11-17 10:03 ` Barry Song
2026-11-18 16:13 ` Dev Jain
` (2 subsequent siblings)
3 siblings, 0 replies; 31+ messages in thread
From: Barry Song @ 2026-11-17 10:03 UTC (permalink / raw)
To: Shivank Garg
Cc: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Youngjun Park,
Minchan Kim, Sergey Senozhatsky, Liam R. Howlett, Lorenzo Stoakes,
Vlastimil Babka, Jann Horn, Pedro Falcato, linux-fsdevel,
linux-mm, linux-kernel
On Tue, Nov 17, 2026 at 3:17 PM Shivank Garg <shivankg@amd.com> wrote:
>
> Its last users were removed in commit 0d6af9bcf383 ("mm, swap: use the
> swap table to track the swap count").
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
Reviewed-by: Barry Song <baohua@kernel.org>
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 3/5] mm/swap: remove unused folio_to_swp_tb()
2026-11-17 7:16 ` [PATCH mm-new v2 3/5] mm/swap: remove unused folio_to_swp_tb() Shivank Garg
2026-11-17 10:03 ` Barry Song
@ 2026-11-18 16:13 ` Dev Jain
2026-11-18 16:23 ` Nhat Pham
2026-11-19 5:35 ` + mm-swap-remove-unused-folio_to_swp_tb.patch added to mm-nonmm-unstable branch Andrew Morton
3 siblings, 0 replies; 31+ messages in thread
From: Dev Jain @ 2026-11-18 16:13 UTC (permalink / raw)
To: Shivank Garg, Matthew Wilcox (Oracle), Jan Kara, Andrew Morton,
Chris Li, Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He,
Barry Song, Youngjun Park, Minchan Kim, Sergey Senozhatsky,
Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn,
Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel
On 17/11/26 12:46 pm, Shivank Garg wrote:
> Its last users were removed in commit 0d6af9bcf383 ("mm, swap: use the
> swap table to track the swap count").
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
Reviewed-by: Dev Jain <dev.jain@arm.com>
> mm/swap_table.h | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/mm/swap_table.h b/mm/swap_table.h
> index 072625d60d54..022d2251884e 100644
> --- a/mm/swap_table.h
> +++ b/mm/swap_table.h
> @@ -135,11 +135,6 @@ static inline unsigned long pfn_to_swp_tb(unsigned long pfn, unsigned char flags
> return swp_tb | __flags_to_swp_tb(flags);
> }
>
> -static inline unsigned long folio_to_swp_tb(struct folio *folio, unsigned char flags)
> -{
> - return pfn_to_swp_tb(folio_pfn(folio), flags);
> -}
> -
> static inline unsigned long shadow_to_swp_tb(void *shadow, unsigned char flags)
> {
> BUILD_BUG_ON((BITS_PER_XA_VALUE + 1) !=
>
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 3/5] mm/swap: remove unused folio_to_swp_tb()
2026-11-17 7:16 ` [PATCH mm-new v2 3/5] mm/swap: remove unused folio_to_swp_tb() Shivank Garg
2026-11-17 10:03 ` Barry Song
2026-11-18 16:13 ` Dev Jain
@ 2026-11-18 16:23 ` Nhat Pham
2026-11-19 5:35 ` + mm-swap-remove-unused-folio_to_swp_tb.patch added to mm-nonmm-unstable branch Andrew Morton
3 siblings, 0 replies; 31+ messages in thread
From: Nhat Pham @ 2026-11-18 16:23 UTC (permalink / raw)
To: Shivank Garg
Cc: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Baoquan He, Barry Song, Youngjun Park,
Minchan Kim, Sergey Senozhatsky, Liam R. Howlett, Lorenzo Stoakes,
Vlastimil Babka, Jann Horn, Pedro Falcato, linux-fsdevel,
linux-mm, linux-kernel
On Mon, Nov 16, 2026 at 11:17 PM Shivank Garg <shivankg@amd.com> wrote:
>
> Its last users were removed in commit 0d6af9bcf383 ("mm, swap: use the
> swap table to track the swap count").
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
^ permalink raw reply [flat|nested] 31+ messages in thread* + mm-swap-remove-unused-folio_to_swp_tb.patch added to mm-nonmm-unstable branch
2026-11-17 7:16 ` [PATCH mm-new v2 3/5] mm/swap: remove unused folio_to_swp_tb() Shivank Garg
` (2 preceding siblings ...)
2026-11-18 16:23 ` Nhat Pham
@ 2026-11-19 5:35 ` Andrew Morton
3 siblings, 0 replies; 31+ messages in thread
From: Andrew Morton @ 2026-11-19 5:35 UTC (permalink / raw)
To: mm-commits, youngjun.park, willy, vbabka, shikemeng, senozhatsky,
pfalcato, nphamcs, minchan, ljs, liam, kasong, jannh, jack,
dev.jain, chrisl, baoquan.he, baohua, shivankg, akpm
The patch titled
Subject: mm/swap: remove unused folio_to_swp_tb()
has been added to the -mm mm-nonmm-unstable branch. Its filename is
mm-swap-remove-unused-folio_to_swp_tb.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-swap-remove-unused-folio_to_swp_tb.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Shivank Garg <shivankg@amd.com>
Subject: mm/swap: remove unused folio_to_swp_tb()
Date: Tue, 17 Nov 2026 07:16:50 +0000
Its last users were removed in commit 0d6af9bcf383 ("mm, swap: use the
swap table to track the swap count").
Link: https://patch.msgid.link/20261117-unused-sym-mm-v2-3-2f845e94dd50@amd.com
Signed-off-by: Shivank Garg <shivankg@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Barry Song <baohua@kernel.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Christopher Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Youngjun Park <youngjun.park@lge.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
mm/swap_table.h | 5 -----
1 file changed, 5 deletions(-)
--- a/mm/swap_table.h~mm-swap-remove-unused-folio_to_swp_tb
+++ a/mm/swap_table.h
@@ -135,11 +135,6 @@ static inline unsigned long pfn_to_swp_t
return swp_tb | __flags_to_swp_tb(flags);
}
-static inline unsigned long folio_to_swp_tb(struct folio *folio, unsigned char flags)
-{
- return pfn_to_swp_tb(folio_pfn(folio), flags);
-}
-
static inline unsigned long shadow_to_swp_tb(void *shadow, unsigned char flags)
{
BUILD_BUG_ON((BITS_PER_XA_VALUE + 1) !=
_
Patches currently in -mm which might be from shivankg@amd.com are
mm-remove-unused-helpers-from-pagemaph.patch
mm-swapops-remove-unused-make_guard_swp_entry.patch
mm-swap-remove-unused-folio_to_swp_tb.patch
mm-zsmalloc-remove-unused-zpdesc_lock.patch
mm-nommu-remove-unused-heap_stack_gap.patch
^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock()
2026-11-17 7:16 [PATCH mm-new v2 0/5] mm: remove unused functions Shivank Garg
` (2 preceding siblings ...)
2026-11-17 7:16 ` [PATCH mm-new v2 3/5] mm/swap: remove unused folio_to_swp_tb() Shivank Garg
@ 2026-11-17 7:16 ` Shivank Garg
2026-11-17 10:04 ` Barry Song
` (4 more replies)
2026-11-17 7:16 ` [PATCH mm-new v2 5/5] mm: nommu: remove unused heap_stack_gap Shivank Garg
2026-11-18 17:05 ` [PATCH mm-new v2 0/5] mm: remove unused functions Dev Jain
5 siblings, 5 replies; 31+ messages in thread
From: Shivank Garg @ 2026-11-17 7:16 UTC (permalink / raw)
To: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Barry Song,
Youngjun Park, Minchan Kim, Sergey Senozhatsky, Liam R. Howlett,
Lorenzo Stoakes, Vlastimil Babka, Jann Horn, Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel, Shivank Garg
It was added in commit c1b3bb73d55e ("mm/zsmalloc: use zpdesc in
trylock_zspage()/lock_zspage()") but has never had a caller.
Signed-off-by: Shivank Garg <shivankg@amd.com>
---
mm/zpdesc.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/mm/zpdesc.h b/mm/zpdesc.h
index 4fd81c2e8076..aaab5f1bfb52 100644
--- a/mm/zpdesc.h
+++ b/mm/zpdesc.h
@@ -107,11 +107,6 @@ static_assert(sizeof(struct zpdesc) <= sizeof(struct page));
const struct page *: (const struct zpdesc *)(p), \
struct page *: (struct zpdesc *)(p)))
-static inline void zpdesc_lock(struct zpdesc *zpdesc)
-{
- folio_lock(zpdesc_folio(zpdesc));
-}
-
static inline bool zpdesc_trylock(struct zpdesc *zpdesc)
{
return folio_trylock(zpdesc_folio(zpdesc));
--
2.53.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock()
2026-11-17 7:16 ` [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock() Shivank Garg
@ 2026-11-17 10:04 ` Barry Song
2026-11-18 2:17 ` Sergey Senozhatsky
` (3 subsequent siblings)
4 siblings, 0 replies; 31+ messages in thread
From: Barry Song @ 2026-11-17 10:04 UTC (permalink / raw)
To: Shivank Garg
Cc: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Youngjun Park,
Minchan Kim, Sergey Senozhatsky, Liam R. Howlett, Lorenzo Stoakes,
Vlastimil Babka, Jann Horn, Pedro Falcato, linux-fsdevel,
linux-mm, linux-kernel
On Tue, Nov 17, 2026 at 3:17 PM Shivank Garg <shivankg@amd.com> wrote:
>
> It was added in commit c1b3bb73d55e ("mm/zsmalloc: use zpdesc in
> trylock_zspage()/lock_zspage()") but has never had a caller.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
> mm/zpdesc.h | 5 -----
> 1 file changed, 5 deletions(-)
Reviewed-by: Barry Song <baohua@kernel.org>
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock()
2026-11-17 7:16 ` [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock() Shivank Garg
2026-11-17 10:04 ` Barry Song
@ 2026-11-18 2:17 ` Sergey Senozhatsky
2026-11-19 4:36 ` Dev Jain
` (2 subsequent siblings)
4 siblings, 0 replies; 31+ messages in thread
From: Sergey Senozhatsky @ 2026-11-18 2:17 UTC (permalink / raw)
To: Shivank Garg
Cc: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Barry Song,
Youngjun Park, Minchan Kim, Sergey Senozhatsky, Liam R. Howlett,
Lorenzo Stoakes, Vlastimil Babka, Jann Horn, Pedro Falcato,
linux-fsdevel, linux-mm, linux-kernel
On (26/11/17 07:16), Shivank Garg wrote:
> It was added in commit c1b3bb73d55e ("mm/zsmalloc: use zpdesc in
> trylock_zspage()/lock_zspage()") but has never had a caller.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock()
2026-11-17 7:16 ` [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock() Shivank Garg
2026-11-17 10:04 ` Barry Song
2026-11-18 2:17 ` Sergey Senozhatsky
@ 2026-11-19 4:36 ` Dev Jain
2026-11-19 5:35 ` + mm-zsmalloc-remove-unused-zpdesc_lock.patch added to mm-nonmm-unstable branch Andrew Morton
2026-11-19 19:14 ` [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock() Nhat Pham
4 siblings, 0 replies; 31+ messages in thread
From: Dev Jain @ 2026-11-19 4:36 UTC (permalink / raw)
To: Shivank Garg, Matthew Wilcox (Oracle), Jan Kara, Andrew Morton,
Chris Li, Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He,
Barry Song, Youngjun Park, Minchan Kim, Sergey Senozhatsky,
Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn,
Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel
On 17/11/26 12:46 pm, Shivank Garg wrote:
> It was added in commit c1b3bb73d55e ("mm/zsmalloc: use zpdesc in
This was in late 2024 so seems fine.
> trylock_zspage()/lock_zspage()") but has never had a caller.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
Reviewed-by: Dev Jain <dev.jain@arm.com>
> mm/zpdesc.h | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/mm/zpdesc.h b/mm/zpdesc.h
> index 4fd81c2e8076..aaab5f1bfb52 100644
> --- a/mm/zpdesc.h
> +++ b/mm/zpdesc.h
> @@ -107,11 +107,6 @@ static_assert(sizeof(struct zpdesc) <= sizeof(struct page));
> const struct page *: (const struct zpdesc *)(p), \
> struct page *: (struct zpdesc *)(p)))
>
> -static inline void zpdesc_lock(struct zpdesc *zpdesc)
> -{
> - folio_lock(zpdesc_folio(zpdesc));
> -}
> -
> static inline bool zpdesc_trylock(struct zpdesc *zpdesc)
> {
> return folio_trylock(zpdesc_folio(zpdesc));
>
^ permalink raw reply [flat|nested] 31+ messages in thread* + mm-zsmalloc-remove-unused-zpdesc_lock.patch added to mm-nonmm-unstable branch
2026-11-17 7:16 ` [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock() Shivank Garg
` (2 preceding siblings ...)
2026-11-19 4:36 ` Dev Jain
@ 2026-11-19 5:35 ` Andrew Morton
2026-11-19 19:14 ` [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock() Nhat Pham
4 siblings, 0 replies; 31+ messages in thread
From: Andrew Morton @ 2026-11-19 5:35 UTC (permalink / raw)
To: mm-commits, youngjun.park, willy, vbabka, shikemeng, senozhatsky,
pfalcato, nphamcs, minchan, ljs, liam, kasong, jannh, jack,
dev.jain, chrisl, baoquan.he, baohua, shivankg, akpm
The patch titled
Subject: mm/zsmalloc: remove unused zpdesc_lock()
has been added to the -mm mm-nonmm-unstable branch. Its filename is
mm-zsmalloc-remove-unused-zpdesc_lock.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-zsmalloc-remove-unused-zpdesc_lock.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Shivank Garg <shivankg@amd.com>
Subject: mm/zsmalloc: remove unused zpdesc_lock()
Date: Tue, 17 Nov 2026 07:16:51 +0000
It was added in commit c1b3bb73d55e ("mm/zsmalloc: use zpdesc in
trylock_zspage()/lock_zspage()") but has never had a caller.
Link: https://patch.msgid.link/20261117-unused-sym-mm-v2-4-2f845e94dd50@amd.com
Signed-off-by: Shivank Garg <shivankg@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Christopher Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Youngjun Park <youngjun.park@lge.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
mm/zpdesc.h | 5 -----
1 file changed, 5 deletions(-)
--- a/mm/zpdesc.h~mm-zsmalloc-remove-unused-zpdesc_lock
+++ a/mm/zpdesc.h
@@ -107,11 +107,6 @@ static_assert(sizeof(struct zpdesc) <= s
const struct page *: (const struct zpdesc *)(p), \
struct page *: (struct zpdesc *)(p)))
-static inline void zpdesc_lock(struct zpdesc *zpdesc)
-{
- folio_lock(zpdesc_folio(zpdesc));
-}
-
static inline bool zpdesc_trylock(struct zpdesc *zpdesc)
{
return folio_trylock(zpdesc_folio(zpdesc));
_
Patches currently in -mm which might be from shivankg@amd.com are
mm-remove-unused-helpers-from-pagemaph.patch
mm-swapops-remove-unused-make_guard_swp_entry.patch
mm-swap-remove-unused-folio_to_swp_tb.patch
mm-zsmalloc-remove-unused-zpdesc_lock.patch
mm-nommu-remove-unused-heap_stack_gap.patch
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock()
2026-11-17 7:16 ` [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock() Shivank Garg
` (3 preceding siblings ...)
2026-11-19 5:35 ` + mm-zsmalloc-remove-unused-zpdesc_lock.patch added to mm-nonmm-unstable branch Andrew Morton
@ 2026-11-19 19:14 ` Nhat Pham
4 siblings, 0 replies; 31+ messages in thread
From: Nhat Pham @ 2026-11-19 19:14 UTC (permalink / raw)
To: Shivank Garg
Cc: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Baoquan He, Barry Song, Youngjun Park,
Minchan Kim, Sergey Senozhatsky, Liam R. Howlett, Lorenzo Stoakes,
Vlastimil Babka, Jann Horn, Pedro Falcato, linux-fsdevel,
linux-mm, linux-kernel
On Mon, Nov 16, 2026 at 11:17 PM Shivank Garg <shivankg@amd.com> wrote:
>
> It was added in commit c1b3bb73d55e ("mm/zsmalloc: use zpdesc in
> trylock_zspage()/lock_zspage()") but has never had a caller.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH mm-new v2 5/5] mm: nommu: remove unused heap_stack_gap
2026-11-17 7:16 [PATCH mm-new v2 0/5] mm: remove unused functions Shivank Garg
` (3 preceding siblings ...)
2026-11-17 7:16 ` [PATCH mm-new v2 4/5] mm/zsmalloc: remove unused zpdesc_lock() Shivank Garg
@ 2026-11-17 7:16 ` Shivank Garg
2026-11-17 10:07 ` Barry Song
` (2 more replies)
2026-11-18 17:05 ` [PATCH mm-new v2 0/5] mm: remove unused functions Dev Jain
5 siblings, 3 replies; 31+ messages in thread
From: Shivank Garg @ 2026-11-17 7:16 UTC (permalink / raw)
To: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Barry Song,
Youngjun Park, Minchan Kim, Sergey Senozhatsky, Liam R. Howlett,
Lorenzo Stoakes, Vlastimil Babka, Jann Horn, Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel, Shivank Garg
heap_stack_gap has been unused since at least the start of git history,
commit 1da177e4c3f4 ("Linux-2.6.12-rc2").
Link: https://lore.kernel.org/linux-mm/20140430083620.GA4711@dhcp22.suse.cz/
Signed-off-by: Shivank Garg <shivankg@amd.com>
---
mm/nommu.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/mm/nommu.c b/mm/nommu.c
index df99495c8902..a971c12f2732 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -43,7 +43,6 @@
#include "internal.h"
unsigned long highest_memmap_pfn;
-int heap_stack_gap = 0;
atomic_long_t mmap_pages_allocated;
--
2.53.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 5/5] mm: nommu: remove unused heap_stack_gap
2026-11-17 7:16 ` [PATCH mm-new v2 5/5] mm: nommu: remove unused heap_stack_gap Shivank Garg
@ 2026-11-17 10:07 ` Barry Song
2026-11-19 4:38 ` Dev Jain
2026-11-19 5:35 ` + mm-nommu-remove-unused-heap_stack_gap.patch added to mm-nonmm-unstable branch Andrew Morton
2 siblings, 0 replies; 31+ messages in thread
From: Barry Song @ 2026-11-17 10:07 UTC (permalink / raw)
To: Shivank Garg
Cc: Matthew Wilcox (Oracle), Jan Kara, Andrew Morton, Chris Li,
Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He, Youngjun Park,
Minchan Kim, Sergey Senozhatsky, Liam R. Howlett, Lorenzo Stoakes,
Vlastimil Babka, Jann Horn, Pedro Falcato, linux-fsdevel,
linux-mm, linux-kernel
On Tue, Nov 17, 2026 at 3:17 PM Shivank Garg <shivankg@amd.com> wrote:
>
> heap_stack_gap has been unused since at least the start of git history,
> commit 1da177e4c3f4 ("Linux-2.6.12-rc2").
>
> Link: https://lore.kernel.org/linux-mm/20140430083620.GA4711@dhcp22.suse.cz/
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
> mm/nommu.c | 1 -
> 1 file changed, 1 deletion(-)
Reviewed-by: Barry Song <baohua@kernel.org>
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 5/5] mm: nommu: remove unused heap_stack_gap
2026-11-17 7:16 ` [PATCH mm-new v2 5/5] mm: nommu: remove unused heap_stack_gap Shivank Garg
2026-11-17 10:07 ` Barry Song
@ 2026-11-19 4:38 ` Dev Jain
2026-11-19 5:35 ` + mm-nommu-remove-unused-heap_stack_gap.patch added to mm-nonmm-unstable branch Andrew Morton
2 siblings, 0 replies; 31+ messages in thread
From: Dev Jain @ 2026-11-19 4:38 UTC (permalink / raw)
To: Shivank Garg, Matthew Wilcox (Oracle), Jan Kara, Andrew Morton,
Chris Li, Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He,
Barry Song, Youngjun Park, Minchan Kim, Sergey Senozhatsky,
Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn,
Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel
On 17/11/26 12:46 pm, Shivank Garg wrote:
> heap_stack_gap has been unused since at least the start of git history,
> commit 1da177e4c3f4 ("Linux-2.6.12-rc2").
>
> Link: https://lore.kernel.org/linux-mm/20140430083620.GA4711@dhcp22.suse.cz/
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
Reviewed-by: Dev Jain <dev.jain@arm.com>
> mm/nommu.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/mm/nommu.c b/mm/nommu.c
> index df99495c8902..a971c12f2732 100644
> --- a/mm/nommu.c
> +++ b/mm/nommu.c
> @@ -43,7 +43,6 @@
> #include "internal.h"
>
> unsigned long highest_memmap_pfn;
> -int heap_stack_gap = 0;
>
> atomic_long_t mmap_pages_allocated;
>
>
^ permalink raw reply [flat|nested] 31+ messages in thread* + mm-nommu-remove-unused-heap_stack_gap.patch added to mm-nonmm-unstable branch
2026-11-17 7:16 ` [PATCH mm-new v2 5/5] mm: nommu: remove unused heap_stack_gap Shivank Garg
2026-11-17 10:07 ` Barry Song
2026-11-19 4:38 ` Dev Jain
@ 2026-11-19 5:35 ` Andrew Morton
2 siblings, 0 replies; 31+ messages in thread
From: Andrew Morton @ 2026-11-19 5:35 UTC (permalink / raw)
To: mm-commits, youngjun.park, willy, vbabka, shikemeng, senozhatsky,
pfalcato, nphamcs, minchan, ljs, liam, kasong, jannh, jack,
dev.jain, chrisl, baoquan.he, baohua, shivankg, akpm
The patch titled
Subject: mm: nommu: remove unused heap_stack_gap
has been added to the -mm mm-nonmm-unstable branch. Its filename is
mm-nommu-remove-unused-heap_stack_gap.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-nommu-remove-unused-heap_stack_gap.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Shivank Garg <shivankg@amd.com>
Subject: mm: nommu: remove unused heap_stack_gap
Date: Tue, 17 Nov 2026 07:16:52 +0000
heap_stack_gap has been unused since at least the start of git history,
commit 1da177e4c3f4 ("Linux-2.6.12-rc2").
Link: https://patch.msgid.link/20261117-unused-sym-mm-v2-5-2f845e94dd50@amd.com
Link: https://lore.kernel.org/linux-mm/20140430083620.GA4711@dhcp22.suse.cz/
Signed-off-by: Shivank Garg <shivankg@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Barry Song <baohua@kernel.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Christopher Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Youngjun Park <youngjun.park@lge.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
mm/nommu.c | 1 -
1 file changed, 1 deletion(-)
--- a/mm/nommu.c~mm-nommu-remove-unused-heap_stack_gap
+++ a/mm/nommu.c
@@ -43,7 +43,6 @@
#include "internal.h"
unsigned long highest_memmap_pfn;
-int heap_stack_gap = 0;
atomic_long_t mmap_pages_allocated;
_
Patches currently in -mm which might be from shivankg@amd.com are
mm-remove-unused-helpers-from-pagemaph.patch
mm-swapops-remove-unused-make_guard_swp_entry.patch
mm-swap-remove-unused-folio_to_swp_tb.patch
mm-zsmalloc-remove-unused-zpdesc_lock.patch
mm-nommu-remove-unused-heap_stack_gap.patch
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH mm-new v2 0/5] mm: remove unused functions
2026-11-17 7:16 [PATCH mm-new v2 0/5] mm: remove unused functions Shivank Garg
` (4 preceding siblings ...)
2026-11-17 7:16 ` [PATCH mm-new v2 5/5] mm: nommu: remove unused heap_stack_gap Shivank Garg
@ 2026-11-18 17:05 ` Dev Jain
2026-11-18 17:14 ` Dev Jain
5 siblings, 1 reply; 31+ messages in thread
From: Dev Jain @ 2026-11-18 17:05 UTC (permalink / raw)
To: Shivank Garg, Matthew Wilcox (Oracle), Jan Kara, Andrew Morton,
Chris Li, Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He,
Barry Song, Youngjun Park, Minchan Kim, Sergey Senozhatsky,
Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn,
Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel
On 17/11/26 12:46 pm, Shivank Garg wrote:
> This series removes five functions and one variable in mm that have no
> users left anywhere in the tree. I found them with the kunused scripts
> [1], which I wrote with LLM's help. The v1 cover letter [2] has more
> details on the scripts and how LLM was used.
>
> Changes in v2:
> - Split v1 [2] up by MM tree, as David suggested. These five patches
> are based on mm-new.
> - No changes to the patches themselves.
>
> [1] https://github.com/AMDESE/linux-mm/tree/shivank/kunused
> [2] https://lore.kernel.org/r/20261026-unused-sym-v1-0-82ca2dceabe1@amd.com
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
Okay I just recalled that there have been numerous cases where people ran
scripts / compiler with flags etc and sent patches to remove unused functions,
but maintainers rejected them citing they are there for a future use. Here
are some of those instances:
https://lore.kernel.org/all/20240907021506.4018676-1-Liam.Howlett@oracle.com/
https://lore.kernel.org/linux-mm/20100211052247.GA15392@localhost/
So I think the commit messages need to do more, they need to prove that the
unused function was a genuine oversight.
> Shivank Garg (5):
> mm: remove unused helpers from pagemap.h
> mm/swapops: remove unused make_guard_swp_entry()
> mm/swap: remove unused folio_to_swp_tb()
> mm/zsmalloc: remove unused zpdesc_lock()
> mm: nommu: remove unused heap_stack_gap
>
> include/linux/pagemap.h | 11 -----------
> include/linux/swapops.h | 5 -----
> mm/nommu.c | 1 -
> mm/swap_table.h | 5 -----
> mm/zpdesc.h | 5 -----
> 5 files changed, 27 deletions(-)
> ---
> base-commit: 67f3b04b277373438f17300e056306adbd9edf7b
> change-id: 20261109-unused-sym-mm-8fa76462573e
>
> Best regards,
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 0/5] mm: remove unused functions
2026-11-18 17:05 ` [PATCH mm-new v2 0/5] mm: remove unused functions Dev Jain
@ 2026-11-18 17:14 ` Dev Jain
2026-11-18 18:55 ` Garg, Shivank
0 siblings, 1 reply; 31+ messages in thread
From: Dev Jain @ 2026-11-18 17:14 UTC (permalink / raw)
To: Shivank Garg, Matthew Wilcox (Oracle), Jan Kara, Andrew Morton,
Chris Li, Kairui Song, Kemeng Shi, Nhat Pham, Baoquan He,
Barry Song, Youngjun Park, Minchan Kim, Sergey Senozhatsky,
Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn,
Pedro Falcato
Cc: linux-fsdevel, linux-mm, linux-kernel
On 18/11/26 10:35 pm, Dev Jain wrote:
>
>
> On 17/11/26 12:46 pm, Shivank Garg wrote:
>> This series removes five functions and one variable in mm that have no
>> users left anywhere in the tree. I found them with the kunused scripts
>> [1], which I wrote with LLM's help. The v1 cover letter [2] has more
>> details on the scripts and how LLM was used.
>>
>> Changes in v2:
>> - Split v1 [2] up by MM tree, as David suggested. These five patches
>> are based on mm-new.
>> - No changes to the patches themselves.
>>
>> [1] https://github.com/AMDESE/linux-mm/tree/shivank/kunused
>> [2] https://lore.kernel.org/r/20261026-unused-sym-v1-0-82ca2dceabe1@amd.com
>>
>> Signed-off-by: Shivank Garg <shivankg@amd.com>
>> ---
>
> Okay I just recalled that there have been numerous cases where people ran
> scripts / compiler with flags etc and sent patches to remove unused functions,
> but maintainers rejected them citing they are there for a future use. Here
> are some of those instances:
>
> https://lore.kernel.org/all/20240907021506.4018676-1-Liam.Howlett@oracle.com/
> https://lore.kernel.org/linux-mm/20100211052247.GA15392@localhost/
>
> So I think the commit messages need to do more, they need to prove that the
> unused function was a genuine oversight.
>
One way to do that would be to mention the commit and its date, if its too old,
or, if it was part of a patch series but then the author changed their
strategy in the later patches making the function redundant, etc etc.
In patch 1, you remove mapping_clear_release_always() but d73065e60dcc 's description
implies it is going to get used, which is confusing. Maybe we are missing
a genuine bug, or the author forgot to drop the stale description across
revisions.
>
>
>> Shivank Garg (5):
>> mm: remove unused helpers from pagemap.h
>> mm/swapops: remove unused make_guard_swp_entry()
>> mm/swap: remove unused folio_to_swp_tb()
>> mm/zsmalloc: remove unused zpdesc_lock()
>> mm: nommu: remove unused heap_stack_gap
>>
>> include/linux/pagemap.h | 11 -----------
>> include/linux/swapops.h | 5 -----
>> mm/nommu.c | 1 -
>> mm/swap_table.h | 5 -----
>> mm/zpdesc.h | 5 -----
>> 5 files changed, 27 deletions(-)
>> ---
>> base-commit: 67f3b04b277373438f17300e056306adbd9edf7b
>> change-id: 20261109-unused-sym-mm-8fa76462573e
>>
>> Best regards,
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH mm-new v2 0/5] mm: remove unused functions
2026-11-18 17:14 ` Dev Jain
@ 2026-11-18 18:55 ` Garg, Shivank
2026-11-19 3:55 ` Dev Jain
0 siblings, 1 reply; 31+ messages in thread
From: Garg, Shivank @ 2026-11-18 18:55 UTC (permalink / raw)
To: pfalcato@suse.de, nphamcs@gmail.com, chrisl@kernel.org,
shikemeng@huaweicloud.com, vbabka@kernel.org, willy@infradead.org,
akpm@linux-foundation.org, dev.jain@arm.com,
youngjun.park@lge.com, jack@suse.cz, minchan@kernel.org,
liam@infradead.org, baohua@kernel.org, kasong@tencent.com,
jannh@google.com, ljs@kernel.org, baoquan.he@linux.dev,
senozhatsky@chromium.org
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
On Wed, 2026-11-18 at 22:44 +0530, Dev Jain wrote:
>
> On 18/11/26 10:35 pm, Dev Jain wrote:
> >
> >
> > On 17/11/26 12:46 pm, Shivank Garg wrote:
> > > This series removes five functions and one variable in mm that have no
> > > users left anywhere in the tree. I found them with the kunused scripts
> > > [1], which I wrote with LLM's help. The v1 cover letter [2] has more
> > > details on the scripts and how LLM was used.
> > >
> > > Changes in v2:
> > > - Split v1 [2] up by MM tree, as David suggested. These five patches
> > > are based on mm-new.
> > > - No changes to the patches themselves.
> > >
> > > [1] https://github.com/AMDESE/linux-mm/tree/shivank/kunused
> > > [2] https://lore.kernel.org/r/20261026-unused-sym-v1-0-82ca2dceabe1@amd.com
> > >
> > > Signed-off-by: Shivank Garg <shivankg@amd.com>
> > > ---
> >
> > Okay I just recalled that there have been numerous cases where people ran
> > scripts / compiler with flags etc and sent patches to remove unused functions,
> > but maintainers rejected them citing they are there for a future use. Here
> > are some of those instances:
> >
> > https://lore.kernel.org/all/20240907021506.4018676-1-Liam.Howlett@oracle.com/
> > https://lore.kernel.org/linux-mm/20100211052247.GA15392@localhost/
> >
> > So I think the commit messages need to do more, they need to prove that the
> > unused function was a genuine oversight.
> >
>
> One way to do that would be to mention the commit and its date, if its too old,
> or, if it was part of a patch series but then the author changed their
> strategy in the later patches making the function redundant, etc etc.
>
> In patch 1, you remove mapping_clear_release_always() but d73065e60dcc 's description
> implies it is going to get used, which is confusing. Maybe we are missing
> a genuine bug, or the author forgot to drop the stale description across
> revisions.
>
Hi Dev,
Thanks for the review. I agree that some unused symbols may be kept
intentionally for a planned future user, which I checked for before
sending.
For most patches I had included some history, like the commit that
removed the last caller or the commit that added them without one. I
missed that for mapping_clear_release_always() in this patch and for
make_guard_swp_entry() in patch 2, so here is the history for both:
- mapping_clear_release_always() was added in b4fa966f03b7 ("mm, netfs,
fscache: stop read optimisation when folio removed from pagecache") and
never had a caller. Earlier version of had called it from ->evict_inode()
but V4 dropped those calls as unnecessary [1] leaving the helper.
- make_guard_swp_entry() was added in 7c53dfbdb024 ("mm: add PTE_MARKER_GUARD
PTE marker"), has never had a caller, and none has been posted in 2 years.
I left some symbols out because a posted series adds callers, for
example folio_dup_file_rmap_pmd() and folio_is_pfmemalloc(), or because
they are one half of a pair whose other half is still used, like
kmsan_poison_memory().
[1] https://lore.kernel.org/all/166924370539.1772793.13730698360771821317.stgit@warthog.procyon.org.uk
Thanks,
Shivank
^ permalink raw reply [flat|nested] 31+ messages in thread* Re: [PATCH mm-new v2 0/5] mm: remove unused functions
2026-11-18 18:55 ` Garg, Shivank
@ 2026-11-19 3:55 ` Dev Jain
0 siblings, 0 replies; 31+ messages in thread
From: Dev Jain @ 2026-11-19 3:55 UTC (permalink / raw)
To: Garg, Shivank, pfalcato@suse.de, nphamcs@gmail.com,
chrisl@kernel.org, shikemeng@huaweicloud.com, vbabka@kernel.org,
willy@infradead.org, akpm@linux-foundation.org,
youngjun.park@lge.com, jack@suse.cz, minchan@kernel.org,
liam@infradead.org, baohua@kernel.org, kasong@tencent.com,
jannh@google.com, ljs@kernel.org, baoquan.he@linux.dev,
senozhatsky@chromium.org
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
On 19/11/26 12:25 am, Garg, Shivank wrote:
> On Wed, 2026-11-18 at 22:44 +0530, Dev Jain wrote:
>>
>> On 18/11/26 10:35 pm, Dev Jain wrote:
>>>
>>>
>>> On 17/11/26 12:46 pm, Shivank Garg wrote:
>>>> This series removes five functions and one variable in mm that have no
>>>> users left anywhere in the tree. I found them with the kunused scripts
>>>> [1], which I wrote with LLM's help. The v1 cover letter [2] has more
>>>> details on the scripts and how LLM was used.
>>>>
>>>> Changes in v2:
>>>> - Split v1 [2] up by MM tree, as David suggested. These five patches
>>>> are based on mm-new.
>>>> - No changes to the patches themselves.
>>>>
>>>> [1] https://github.com/AMDESE/linux-mm/tree/shivank/kunused
>>>> [2] https://lore.kernel.org/r/20261026-unused-sym-v1-0-82ca2dceabe1@amd.com
>>>>
>>>> Signed-off-by: Shivank Garg <shivankg@amd.com>
>>>> ---
>>>
>>> Okay I just recalled that there have been numerous cases where people ran
>>> scripts / compiler with flags etc and sent patches to remove unused functions,
>>> but maintainers rejected them citing they are there for a future use. Here
>>> are some of those instances:
>>>
>>> https://lore.kernel.org/all/20240907021506.4018676-1-Liam.Howlett@oracle.com/
>>> https://lore.kernel.org/linux-mm/20100211052247.GA15392@localhost/
>>>
>>> So I think the commit messages need to do more, they need to prove that the
>>> unused function was a genuine oversight.
>>>
>>
>> One way to do that would be to mention the commit and its date, if its too old,
>> or, if it was part of a patch series but then the author changed their
>> strategy in the later patches making the function redundant, etc etc.
>>
>> In patch 1, you remove mapping_clear_release_always() but d73065e60dcc 's description
>> implies it is going to get used, which is confusing. Maybe we are missing
>> a genuine bug, or the author forgot to drop the stale description across
>> revisions.
>>
>
> Hi Dev,
>
> Thanks for the review. I agree that some unused symbols may be kept
> intentionally for a planned future user, which I checked for before
> sending.
>
> For most patches I had included some history, like the commit that
> removed the last caller or the commit that added them without one. I
> missed that for mapping_clear_release_always() in this patch and for
> make_guard_swp_entry() in patch 2, so here is the history for both:
>
> - mapping_clear_release_always() was added in b4fa966f03b7 ("mm, netfs,
> fscache: stop read optimisation when folio removed from pagecache") and
> never had a caller. Earlier version of had called it from ->evict_inode()
> but V4 dropped those calls as unnecessary [1] leaving the helper.
>
> - make_guard_swp_entry() was added in 7c53dfbdb024 ("mm: add PTE_MARKER_GUARD
> PTE marker"), has never had a caller, and none has been posted in 2 years.
>
> I left some symbols out because a posted series adds callers, for
> example folio_dup_file_rmap_pmd() and folio_is_pfmemalloc(), or because
> they are one half of a pair whose other half is still used, like
> kmsan_poison_memory().
>
> [1] https://lore.kernel.org/all/166924370539.1772793.13730698360771821317.stgit@warthog.procyon.org.uk
Thanks! Sounds good, you can reply to the individual patches with the additions
so that akpm/David H. can fold that in.
>
> Thanks,
> Shivank
^ permalink raw reply [flat|nested] 31+ messages in thread