From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795022099; b=XwkZZZpougBlDiqH1G79w2HeQPnz5z24JR9lY+pe1LI8mw05VUXkicbi7uZj184w0Qm/ CQGN6INDVqK/1/9Ps3ryQFWflHsteTQLjZoQK5B95XYc2VkdotYPS2xt3Han8EfcdPinO msRZa8ySrg3K1JVJRPNSdT5XV/BDGFAfv1tciWhwc+Fod0osGA0rREaKmUkKrhcE5b1U7 tyl67zsIqwDHPGlbEMTWwmE3rknlkEULl7HQX/waL4CDQ0hY+kaYiQnLP2vB0MYebPl/P yjv11inHml0OELUl3BhMPsWMhPY6Cm7DpxMxmUw5gAODjaxJ/7di81ONmkc6JClltPg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795022099; h=DMARC-Filter:Received:Received:DKIM-Signature:Message-ID:Date: MIME-Version:User-Agent:Subject:From:To:Cc:References: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=gbPVxoxfdmGztrFbfvbxP7f4LGo/LFsskgdu9AUgwZI=; b=xe4gao2O3L020BCHvQkh3iSwIDdzks59w9U9VVYGymLLfwjVTM+s+NuJCvG6A63wAMCm Bh5w6Oir8G0/QttPZae9M9YVZ8pRMbkTy1WAB5dYZ6ofTiDHEGbAqOoVFYc5/yHr6ial8 ZkbPAMWVu8igY7pSN+QLdi90V+ZQzkbf/pV9n50RuKBuR85ToHhCxdO/dPiXnuSSg8vUP vDXrPOKrlXouwuM4ZjDviieoYBhNBoIUYCcCEOdaQd8VB98DOdj0HmVYv8avYqpgfnzbK i380ZmAT0ws2zzZHLhHNDJxxpMu0Y3ZOFwt3oAbxxQbgTBZVPTFQRsO+yLnSEzozo3w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=ObJGyse0; arc=none smtp.remote-ip=217.140.110.172 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DEC5606A325; Wed, 18 Nov 2026 17:14:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5DEC5606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=ObJGyse0 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 786591477; Wed, 18 Nov 2026 09:14:55 -0800 (PST) Received: from [10.163.128.4] (unknown [10.163.128.4]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CE0A13FA7A; Wed, 18 Nov 2026 09:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1795022098; bh=5sXytsRGFlO2BU3Kh6Jfrdi1zyqcGfoU7pV+yaj3NgQ=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=ObJGyse0OCTPhtZf7rFgkLxKTCVvvloJVnn6RePVP/IphpVVotf7tAexh1rIz4n9D I8itCqr9/ZieVJzN4+0fPTt++ubUiurnd5IKE6/8vOjlZBBcWBpH3p4fTUdmvumzv6 8+03ZM5P+Je0fdgfSQhhy6xOAIWs/XOcinnbY8Vw= Message-ID: <27ef4d8f-f4fa-49aa-b166-8335ca6f5898@arm.com> Date: Wed, 18 Nov 2026 22:44:48 +0530 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH mm-new v2 0/5] mm: remove unused functions From: Dev Jain 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@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20261117-unused-sym-mm-v2-0-2f845e94dd50@amd.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 >> --- > > 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, >