Re: [PATCH mm-new v2 0/5] mm: remove unused functions

From: Dev Jain

Date: Wed Nov 18 2026 - 12:13:38 EST




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@xxxxxxx
>
> Signed-off-by: Shivank Garg <shivankg@xxxxxxx>
> ---

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@xxxxxxxxxx/
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,