[PATCH -next] mm/swap: Remove unused declaration swapcache_clear()

Yue Haibing posted 1 patch 1 month ago
mm/swap.h | 1 -
1 file changed, 1 deletion(-)
[PATCH -next] mm/swap: Remove unused declaration swapcache_clear()
Posted by Yue Haibing 1 month ago
Commit c246d236b18b ("mm/shmem: never bypass the swap cache for
SWP_SYNCHRONOUS_IO") removed the implementations but leave this.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
 mm/swap.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/swap.h b/mm/swap.h
index d077e5893a42..29060a305443 100644
--- a/mm/swap.h
+++ b/mm/swap.h
@@ -344,7 +344,6 @@ void __swap_cache_replace_folio(struct swap_cluster_info *ci,
 				struct folio *old, struct folio *new);
 
 void show_swap_cache_info(void);
-void swapcache_clear(struct swap_info_struct *si, swp_entry_t entry, int nr);
 struct folio *read_swap_cache_async(struct swap_io_ctx *ctx, swp_entry_t entry,
 		gfp_t gfp_mask, struct vm_area_struct *vma, unsigned long addr);
 struct folio *swap_cluster_readahead(swp_entry_t entry, gfp_t flag,
-- 
2.34.1
Re: [PATCH -next] mm/swap: Remove unused declaration swapcache_clear()
Posted by SJ Park 1 month ago
On Thu, 27 Aug 2026 16:27:22 +0800 Yue Haibing <yuehaibing@huawei.com> wrote:

> Commit c246d236b18b ("mm/shmem: never bypass the swap cache for
> SWP_SYNCHRONOUS_IO") removed the implementations but leave this.

Nice catch.

> 
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>

Reviewed-by: SJ Park <sj@kernel.org>


Thanks,
SJ

[...]
Re: [PATCH -next] mm/swap: Remove unused declaration swapcache_clear()
Posted by Barry Song 1 month ago
On Thu, Aug 27, 2026 at 4:06 PM Yue Haibing <yuehaibing@huawei.com> wrote:
>
> Commit c246d236b18b ("mm/shmem: never bypass the swap cache for
> SWP_SYNCHRONOUS_IO") removed the implementations but leave this.
>
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>

Right!
Reviewed-by: Barry Song <baohua@kernel.org>
Re: [PATCH -next] mm/swap: Remove unused declaration swapcache_clear()
Posted by Nick Huang 1 month ago
On Thu, Aug 27, 2026 at 04:27:22PM +0800, Yue Haibing wrote:
> Commit c246d236b18b ("mm/shmem: never bypass the swap cache for
> SWP_SYNCHRONOUS_IO") removed the implementations but leave this.
> 
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> ---
>  mm/swap.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/swap.h b/mm/swap.h
> index d077e5893a42..29060a305443 100644
> --- a/mm/swap.h
> +++ b/mm/swap.h
> @@ -344,7 +344,6 @@ void __swap_cache_replace_folio(struct swap_cluster_info *ci,
>  				struct folio *old, struct folio *new);
>  
>  void show_swap_cache_info(void);
> -void swapcache_clear(struct swap_info_struct *si, swp_entry_t entry, int nr);
>  struct folio *read_swap_cache_async(struct swap_io_ctx *ctx, swp_entry_t entry,
>  		gfp_t gfp_mask, struct vm_area_struct *vma, unsigned long addr);
>  struct folio *swap_cluster_readahead(swp_entry_t entry, gfp_t flag,
> -- 
> 2.34.1
>
I checked the current tree and only the declaration remains:

$ git grep -n 'swapcache_clear'
mm/swap.h:317:void swapcache_clear(struct swap_info_struct *si, swp_entry_t entry, int nr);

Acked-by: Nick Huang <sef1548@gmail.com>
Re: [PATCH -next] mm/swap: Remove unused declaration swapcache_clear()
Posted by Kairui Song 1 month ago
On Thu, Aug 27, 2026 at 4:08 PM Yue Haibing <yuehaibing@huawei.com> wrote:
>
> Commit c246d236b18b ("mm/shmem: never bypass the swap cache for
> SWP_SYNCHRONOUS_IO") removed the implementations but leave this.
>
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> ---
>  mm/swap.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/mm/swap.h b/mm/swap.h
> index d077e5893a42..29060a305443 100644
> --- a/mm/swap.h
> +++ b/mm/swap.h
> @@ -344,7 +344,6 @@ void __swap_cache_replace_folio(struct swap_cluster_info *ci,
>                                 struct folio *old, struct folio *new);
>
>  void show_swap_cache_info(void);
> -void swapcache_clear(struct swap_info_struct *si, swp_entry_t entry, int nr);

Good catch.

Acked-by: Kairui Song <kasong@tencent.com>
Re: [PATCH -next] mm/swap: Remove unused declaration swapcache_clear()
Posted by Baoquan He 1 month ago
On 08/27/26 at 04:27pm, Yue Haibing wrote:
> Commit c246d236b18b ("mm/shmem: never bypass the swap cache for
> SWP_SYNCHRONOUS_IO") removed the implementations but leave this.
> 
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> ---
>  mm/swap.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/swap.h b/mm/swap.h
> index d077e5893a42..29060a305443 100644
> --- a/mm/swap.h
> +++ b/mm/swap.h
> @@ -344,7 +344,6 @@ void __swap_cache_replace_folio(struct swap_cluster_info *ci,
>  				struct folio *old, struct folio *new);
>  
>  void show_swap_cache_info(void);
> -void swapcache_clear(struct swap_info_struct *si, swp_entry_t entry, int nr);
>  struct folio *read_swap_cache_async(struct swap_io_ctx *ctx, swp_entry_t entry,
>  		gfp_t gfp_mask, struct vm_area_struct *vma, unsigned long addr);
>  struct folio *swap_cluster_readahead(swp_entry_t entry, gfp_t flag,

Reviewed-by: Baoquan He <baoquan.he@linux.dev>

> -- 
> 2.34.1
>