From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC546C433E0 for ; Wed, 3 Mar 2021 17:09:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5056A64ED0 for ; Wed, 3 Mar 2021 17:09:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5056A64ED0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AF54D8D0189; Wed, 3 Mar 2021 12:09:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ACBA68D0157; Wed, 3 Mar 2021 12:09:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 994AE8D0189; Wed, 3 Mar 2021 12:09:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0061.hostedemail.com [216.40.44.61]) by kanga.kvack.org (Postfix) with ESMTP id 8164D8D0157 for ; Wed, 3 Mar 2021 12:09:34 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 3A5B78249980 for ; Wed, 3 Mar 2021 17:09:34 +0000 (UTC) X-FDA: 77879199468.05.431CCCD Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf01.hostedemail.com (Postfix) with ESMTP id D509220053D6 for ; Wed, 3 Mar 2021 17:09:25 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 39590AC24; Wed, 3 Mar 2021 17:09:22 +0000 (UTC) Subject: Re: [PATCH] mm/compaction: remove unused variable sysctl_compact_memory To: Pintu Kumar , linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, iamjoonsoo.kim@lge.com, sh_def@163.com, mateusznosek0@gmail.com, bhe@redhat.com, nigupta@nvidia.com, yzaikin@google.com, keescook@chromium.org, mcgrof@kernel.org, mgorman@techsingularity.net Cc: pintu.ping@gmail.com References: <1614707773-10725-1-git-send-email-pintu@codeaurora.org> From: Vlastimil Babka Message-ID: <486d7af3-95a3-9701-f0f9-706ff49b99d1@suse.cz> Date: Wed, 3 Mar 2021 18:09:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <1614707773-10725-1-git-send-email-pintu@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Stat-Signature: cjz7rbqbz1szm9w4i3ibeoef1g6b8eu7 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: D509220053D6 Received-SPF: none (suse.cz>: No applicable sender policy available) receiver=imf01; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1614791365-73781 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 3/2/21 6:56 PM, Pintu Kumar wrote: > The sysctl_compact_memory is mostly unsed in mm/compaction.c > It just acts as a place holder for sysctl. > > Thus we can remove it from here and move the declaration directly > in kernel/sysctl.c itself. > This will also eliminate the extern declaration from header file. > No functionality is broken or changed this way. > > Signed-off-by: Pintu Kumar > Signed-off-by: Pintu Agarwal You should be able to remove the variable completely and set .data to NULL in the corresponding entry. The sysctl_compaction_handler doesn't access it at all. Then you could do the same with drop_caches. Currently drop_caches_sysctl_handler currently writes to it, but that can be avoided using a local variable - see how sysrq_sysctl_handler avoids the global variable and its corresponding .data field is NULL. Vlastimil